Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate the editorconfig files from analyzer #16

Merged
merged 9 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Process {
# Let GitVersion compute the NuGet package version
$version = Exec { & dotnet dotnet-gitversion /output json /showvariable SemVer }

# Generate .editorconfig files for analyzers
Exec { & dotnet run --project=tools/ConfigurationFilesGenerator/ConfigurationFilesGenerator.csproj --configuration Release }

# Pack using NuGet.exe
Exec { & nuget pack Workleap.DotNet.CodingStandards.nuspec -OutputDirectory $outputDir -Version $version -ForceEnglishOutput }

Expand Down
9 changes: 3 additions & 6 deletions src/build/Workleap.DotNet.CodingStandards.targets
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\2_CodeStyle.editorconfig" />

<!-- .NET analyzers configuration for all projects, enforcing C# code style, quality, performance and security -->
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\3_AllProjectsAnalyzers.editorconfig" />
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\analyzers\*.editorconfig" />

<!-- Configure ReSharper analyzers that overlaps with built-in .NET analyzers (only appears in Rider and VisualStudio IDEs) -->
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\4_ReSharperAnalyzers.editorconfig" />
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\3_ReSharperAnalyzers.editorconfig" />

<!-- .NET analyzers configuration only for test projects -->
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\5_TestProjectsAnalyzers.editorconfig" Condition="'$(IsTestProject)' == 'true'" />

<!-- StyleCop analyzers configuration, only included to fill the gap with a very few rules that are not available out of the box in .NET analyzers -->
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\6_StyleCopAnalyzers.editorconfig" />
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)\..\files\4_TestProjectsAnalyzers.editorconfig" Condition="'$(IsTestProject)' == 'true'" />
</ItemGroup>

<!-- Banned Symbols -->
Expand Down
Loading