Compare commits
19 Commits
3266fd5e65
...
876c09f49f
| Author | SHA1 | Date | |
|---|---|---|---|
|
876c09f49f
|
|||
|
c7cfa2b2fc
|
|||
|
f03d4b9e20
|
|||
|
1c7fad5a99
|
|||
|
effd140385
|
|||
|
bc99d28738
|
|||
|
aef9990695
|
|||
|
252595617f
|
|||
|
2a89dc341b
|
|||
|
abf6a1c04a
|
|||
|
bb3cadc731
|
|||
|
1e5caa208f
|
|||
|
384a66e55a
|
|||
|
8002108e5d
|
|||
|
0e65386326
|
|||
|
c12a3a8d5a
|
|||
|
9bab84d53a
|
|||
|
586c92ee49
|
|||
|
5215570111
|
@@ -33,6 +33,7 @@
|
||||
<AnalysisLevel>preview</AnalysisLevel>
|
||||
<AnalysisMode>All</AnalysisMode>
|
||||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
|
||||
<CodeAnalysisTreatWarningsAsErrors Condition="$(CodeAnalysisTreatWarningsAsErrors) == ''">false</CodeAnalysisTreatWarningsAsErrors>
|
||||
<!-- Locked mode should only be enabled on CI -->
|
||||
<RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode>
|
||||
<!-- Use deterministic builds -->
|
||||
@@ -45,9 +46,10 @@
|
||||
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
|
||||
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
|
||||
<ApplicationVisualStyles>true</ApplicationVisualStyles>
|
||||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||
<EmitCompilerGeneratedFiles>false</EmitCompilerGeneratedFiles>
|
||||
<GenerateRequiresPreviewFeaturesAttribute>False</GenerateRequiresPreviewFeaturesAttribute>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);*.log;*.binlog</DefaultItemExcludes>
|
||||
<GenerateSBOM>true</GenerateSBOM>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$(ArtifactsPath) == '' AND $(DisableCustomArtifactsPath) != 'true'">
|
||||
@@ -67,18 +69,18 @@
|
||||
|
||||
<PropertyGroup Label="Project Assets">
|
||||
<ProjectIcon Condition="Exists('$(MSBuildThisFileDirectory)\icon.png')">
|
||||
$(MSBuildThisFileDirectory)\icon.png
|
||||
$(MSBuildThisFileDirectory)icon.png
|
||||
</ProjectIcon>
|
||||
<ProjectIcon Condition="Exists('$(MSBuildProjectDirectory)\icon.png')">
|
||||
$(MSBuildProjectDirectory)\icon.png
|
||||
$(MSBuildProjectDirectory)icon.png
|
||||
</ProjectIcon>
|
||||
<ProjectIconExists Condition="$(ProjectIcon) != ''">true</ProjectIconExists>
|
||||
|
||||
<ProjectReadMe Condition="Exists('$(MSBuildThisFileDirectory)\README.md')">
|
||||
$(MSBuildThisFileDirectory)\README.md
|
||||
$(MSBuildThisFileDirectory)README.md
|
||||
</ProjectReadMe>
|
||||
<ProjectReadMe Condition="Exists('$(MSBuildProjectDirectory)\README.md')">
|
||||
$(MSBuildProjectDirectory)\README.md
|
||||
$(MSBuildProjectDirectory)README.md
|
||||
</ProjectReadMe>
|
||||
<ProjectReadMeExists Condition="$(ProjectReadMe) != ''">true</ProjectReadMeExists>
|
||||
</PropertyGroup>
|
||||
@@ -95,7 +97,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="OpenAPI Analyzers" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'True'">
|
||||
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
|
||||
<OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)/OpenApi</OpenApiDocumentsDirectory>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -145,13 +146,13 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Use readme as nuget information -->
|
||||
<ItemGroup Label="Readme" Condition="$(IsPackable) == 'True' AND $(ProjectReadMe) != ''">
|
||||
<None Include="$(ProjectReadMe)" Pack="true" PackagePath="" Visible="true"/>
|
||||
<ItemGroup Label="Readme" Condition="$(IsPackable) == 'True' AND $(ProjectReadMeExists) == 'True'">
|
||||
<Content Include="$(ProjectReadMe)" PackagePath="README.md" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Use nuget icon -->
|
||||
<ItemGroup Label="Icon" Condition="$(IsPackable) == 'True' AND $(ProjectIconExists) == 'True'">
|
||||
<None Include="$(ProjectIcon)" Pack="true" PackagePath="icon.png" Visible="false"/>
|
||||
<Content Include="$(ProjectIcon)" Pack="true" PackagePath="icon.png" Visible="false"/>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Uses pretty xUnit configuration -->
|
||||
@@ -160,6 +161,12 @@
|
||||
<Content Include="$(MSBuildThisFileDirectory)\xunit.runner.json" Link="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Stylecop Configuration"
|
||||
Condition="Exists('$(MSBuildThisFileDirectory)\stylecop.json')">
|
||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Link="stylecop.json"
|
||||
CopyToOutputDirectory="Never" Visible="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Project internals are exposed to projects named $(Project).Tests by default -->
|
||||
<ItemGroup
|
||||
Condition="@(InternalsVisibleToSuffix->Count()) == 0 AND @(InternalsVisibleTo->Count()) == 0">
|
||||
@@ -200,6 +207,13 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Analyzers">
|
||||
<PackageReference Include="NewStyleCop.Analyzers">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Test Frameworks" Condition="'$(IsTestProject)' == 'true'">
|
||||
<PackageReference Include="NSubstitute"/>
|
||||
<PackageReference Include="NSubstitute.Analyzers.CSharp">
|
||||
@@ -210,6 +224,7 @@
|
||||
|
||||
<ItemGroup Label="SourceLink" Condition="$(IsPackable) == 'true'">
|
||||
<SourceLinkGiteaHost Include="git.kritikos.io"/>
|
||||
<PackageReference Include="Microsoft.Sbom.Targets" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<Project>
|
||||
<ItemGroup Label="Packages">
|
||||
<PackageVersion Include="GitVersion.MsBuild" Version="6.4.0" />
|
||||
<PackageVersion Include="GitVersion.MsBuild" Version="6.5.0" />
|
||||
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.6" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||
<PackageVersion Include="Microsoft.Sbom.Targets" Version="4.1.3" />
|
||||
<PackageVersion Include="NewStyleCop.Analyzers" Version="1.2.0" />
|
||||
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
|
||||
<PackageVersion Include="NSubstitute" Version="5.3.0" />
|
||||
<PackageVersion Include="xunit.v3" Version="2.0.2" />
|
||||
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" />
|
||||
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
|
||||
<PackageVersion Include="xunit.v3" Version="3.2.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -14,13 +14,14 @@
|
||||
<File Path="Directory.Packages.props" />
|
||||
<File Path="dotnet.ruleset" />
|
||||
<File Path="GitVersion.yml" />
|
||||
<File Path="stylecop.json" />
|
||||
<File Path="xunit.runner.json" />
|
||||
</Folder>
|
||||
<Folder Name="/samples/">
|
||||
<File Path="samples\Directory.Build.props" />
|
||||
</Folder>
|
||||
<Folder Name="/src/">
|
||||
<File Path="src\Directory.build.props" />
|
||||
<File Path="src\Directory.Build.props" />
|
||||
</Folder>
|
||||
<Folder Name="/tests/">
|
||||
<File Path="tests\Directory.Build.props" />
|
||||
|
||||
22
dotnet.ruleset
Normal file
22
dotnet.ruleset
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="Kritikos Ruleset" Description="Common roslyn analyser configuration" ToolsVersion="10.0">
|
||||
<Rules AnalyzerId="Microsoft.CodeAnalysis.CSharp" RuleNamespace="Microsoft.CodeAnalysis.CSharp">
|
||||
<Rule Id="CS1573" Action="None" />
|
||||
<Rule Id="CS1591" Action="None" />
|
||||
<Rule Id="CS2008" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
|
||||
<Rule Id="CA1303" Action="None" />
|
||||
<Rule Id="CA1848" Action="None" />
|
||||
<Rule Id="CA2007" Action="None" />
|
||||
<Rule Id="CA1707" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="SerilogAnalyzer" RuleNamespace="SerilogAnalyzer">
|
||||
<Rule Id="Serilog004" Action="None" />
|
||||
</Rules>
|
||||
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
|
||||
<Rule Id="SA1101" Action="None" />
|
||||
<Rule Id="SA1633" Action="None" />
|
||||
<Rule Id="SA1649" Action="None" />
|
||||
</Rules>
|
||||
</RuleSet>
|
||||
47
stylecop.json
Normal file
47
stylecop.json
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/bjornhellander/NewStyleCopAnalyzers/refs/heads/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
|
||||
"settings": {
|
||||
"indentation": {
|
||||
"useTabs": false,
|
||||
"indentationSize": 2
|
||||
},
|
||||
"orderingRules": {
|
||||
"usingDirectivesPlacement": "outsideNamespace",
|
||||
"systemUsingDirectivesFirst": true,
|
||||
"blankLinesBetweenUsingGroups": "require",
|
||||
"elementOrder": [
|
||||
"kind",
|
||||
"accessibility",
|
||||
"constant",
|
||||
"static",
|
||||
"readonly"
|
||||
]
|
||||
},
|
||||
"maintainabilityRules": {
|
||||
"topLevelTypes": [
|
||||
"class",
|
||||
"interface",
|
||||
"struct",
|
||||
"enum"
|
||||
]
|
||||
},
|
||||
"namingRules": {
|
||||
"allowCommonHungarianPrefixes": false,
|
||||
"includeInferredTupleElementNames": true,
|
||||
"tupleElementNameCasing": "PascalCase"
|
||||
},
|
||||
"layoutRules": {
|
||||
"newlineAtEndOfFile": "require",
|
||||
"allowConsecutiveUsings": false,
|
||||
"allowDoWhileOnClosingBrace": true
|
||||
},
|
||||
"readabilityRules": {
|
||||
"allowBuiltInTypeAliases": false
|
||||
},
|
||||
"documentationRules": {
|
||||
"documentExposedElements": true,
|
||||
"documentationCulture": "en-US",
|
||||
"documentInterfaces": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user