Compare commits

...

45 Commits

Author SHA1 Message Date
7eb0f4c6d6 🎉Starts a new project 2026-02-15 15:32:17 +02:00
f462fa7c33 🔀 Merge remote-tracking branch 'template/main' 2026-02-15 15:31:17 +02:00
b2e46fe7a7 🔧 Enables SBOM generation only for packable projects 2026-02-15 15:27:45 +02:00
4119b8c82b 🔧 Updates StyleCop configuration to place using directives outside namespace and removes delegate from top-level types 2026-02-15 15:27:45 +02:00
a15f35aeb8 🔧 Fixes case sensitive path for linux 2026-02-15 15:27:45 +02:00
ab849a8d3b ⬆️ Updates package versions in Directory.Packages.props 2026-02-15 15:27:45 +02:00
50d7e11c16 🔧 Removes deprecated IncludeOpenAPIAnalyzers property 2026-02-15 15:27:45 +02:00
df744087d4 🔧 Adds ruleset for common Roslyn analyzer configuration 2026-02-15 15:27:44 +02:00
6e9450fbf5 🔧 Aligns stylecop rules with C# config 2026-02-15 15:27:44 +02:00
67801c3795 📝 Exposes stylecop.json on the solution 2026-02-15 15:27:44 +02:00
250b6fc5ed 🔧 Updates packaging configuration for README and icon files 2026-02-15 15:27:44 +02:00
6c3c274de5 🔧 Fixes condition for including README in NuGet package 2026-02-15 15:27:44 +02:00
45f6e66174 🔧 Excludes stylecop.json from package outputs 2026-02-15 15:27:44 +02:00
5e9b6ab9de 🔧 Fixes project icon and README paths 2026-02-15 15:27:44 +02:00
0fd028eff6 🔧 Updates Stylecop configuration to use AdditionalFiles instead of Content
This lead to stylecop.json files being published alongside the nugets
2026-02-15 15:27:43 +02:00
286d8fdc7e 🔧 Adds PackageReference for Microsoft.Sbom.Targets 2026-02-15 15:27:43 +02:00
6ad3aac084 Adds Stylecop replacement package 2026-02-15 15:27:43 +02:00
09668de51c 💄 Basic styling guide for stylecop 2026-02-15 15:27:43 +02:00
7df22a4413 🔧 Set Configuration analysis if it hasn't been overriden 2026-02-15 15:27:43 +02:00
37603dedf2 🔧 Uses Stylecop configuration if present 2026-02-15 15:27:43 +02:00
f3a4c804b7 🔧 Disable source generated files 2026-02-15 15:27:43 +02:00
02d5746360 🔧 Adds SBOM for nuget packages 2026-02-15 15:27:43 +02:00
ad61e47a17 ⬆️ Updates package versions in Directory.Packages.props 2026-02-15 15:27:01 +02:00
4fdcec1a13 Merge pull request #6 from kritikos-io/main-Apollo
Main apollo
2026-02-15 15:24:35 +02:00
876c09f49f 🔧 Updates StyleCop configuration to place using directives outside namespace and removes delegate from top-level types 2026-02-15 15:21:28 +02:00
c7cfa2b2fc 🔧 Fixes case sensitive path for linux 2025-12-30 05:18:27 +02:00
f03d4b9e20 ⬆️ Updates package versions in Directory.Packages.props 2025-11-20 12:03:21 +02:00
1c7fad5a99 🔧 Removes deprecated IncludeOpenAPIAnalyzers property 2025-11-20 11:59:14 +02:00
effd140385 🔧 Adds ruleset for common Roslyn analyzer configuration 2025-11-13 15:54:10 +02:00
bc99d28738 🔧 Aligns stylecop rules with C# config 2025-11-13 15:41:27 +02:00
aef9990695 📝 Exposes stylecop.json on the solution 2025-11-13 14:34:04 +02:00
252595617f 🔧 Updates packaging configuration for README and icon files 2025-11-12 04:36:39 +02:00
2a89dc341b 🔧 Fixes condition for including README in NuGet package 2025-11-12 04:36:01 +02:00
abf6a1c04a 🔧 Excludes stylecop.json from package outputs 2025-11-12 04:34:37 +02:00
bb3cadc731 🔧 Fixes project icon and README paths 2025-11-12 04:33:42 +02:00
1e5caa208f 🔧 Updates Stylecop configuration to use AdditionalFiles instead of Content
This lead to stylecop.json files being published alongside the nugets
2025-11-11 23:55:55 +02:00
4efb21ca1c 🔧 Enables SBOM generation only for packable projects 2025-11-11 02:28:19 +02:00
2b6659239d 🔥 Removes deprecated OpenAPI Analyzers property 2025-11-11 02:27:42 +02:00
384a66e55a 🔧 Adds PackageReference for Microsoft.Sbom.Targets 2025-11-11 02:08:20 +02:00
8002108e5d Adds Stylecop replacement package 2025-11-05 16:08:41 +02:00
0e65386326 💄 Basic styling guide for stylecop 2025-11-05 16:05:49 +02:00
c12a3a8d5a 🔧 Set Configuration analysis if it hasn't been overriden 2025-11-05 16:05:27 +02:00
9bab84d53a 🔧 Uses Stylecop configuration if present 2025-11-05 16:00:42 +02:00
586c92ee49 🔧 Disable source generated files 2025-11-05 16:00:09 +02:00
5215570111 🔧 Adds SBOM for nuget packages 2025-11-05 15:59:36 +02:00
7 changed files with 103 additions and 16 deletions

View File

@@ -33,6 +33,7 @@
<AnalysisLevel>preview</AnalysisLevel> <AnalysisLevel>preview</AnalysisLevel>
<AnalysisMode>All</AnalysisMode> <AnalysisMode>All</AnalysisMode>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> <EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<CodeAnalysisTreatWarningsAsErrors Condition="$(CodeAnalysisTreatWarningsAsErrors) == ''">false</CodeAnalysisTreatWarningsAsErrors>
<!-- Locked mode should only be enabled on CI --> <!-- Locked mode should only be enabled on CI -->
<RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode> <RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode>
<!-- Use deterministic builds --> <!-- Use deterministic builds -->
@@ -45,7 +46,7 @@
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow> <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode> <ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
<ApplicationVisualStyles>true</ApplicationVisualStyles> <ApplicationVisualStyles>true</ApplicationVisualStyles>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> <EmitCompilerGeneratedFiles>false</EmitCompilerGeneratedFiles>
<GenerateRequiresPreviewFeaturesAttribute>False</GenerateRequiresPreviewFeaturesAttribute> <GenerateRequiresPreviewFeaturesAttribute>False</GenerateRequiresPreviewFeaturesAttribute>
<DefaultItemExcludes>$(DefaultItemExcludes);*.log;*.binlog</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);*.log;*.binlog</DefaultItemExcludes>
</PropertyGroup> </PropertyGroup>
@@ -67,18 +68,18 @@
<PropertyGroup Label="Project Assets"> <PropertyGroup Label="Project Assets">
<ProjectIcon Condition="Exists('$(MSBuildThisFileDirectory)\icon.png')"> <ProjectIcon Condition="Exists('$(MSBuildThisFileDirectory)\icon.png')">
$(MSBuildThisFileDirectory)\icon.png $(MSBuildThisFileDirectory)icon.png
</ProjectIcon> </ProjectIcon>
<ProjectIcon Condition="Exists('$(MSBuildProjectDirectory)\icon.png')"> <ProjectIcon Condition="Exists('$(MSBuildProjectDirectory)\icon.png')">
$(MSBuildProjectDirectory)\icon.png $(MSBuildProjectDirectory)icon.png
</ProjectIcon> </ProjectIcon>
<ProjectIconExists Condition="$(ProjectIcon) != ''">true</ProjectIconExists> <ProjectIconExists Condition="$(ProjectIcon) != ''">true</ProjectIconExists>
<ProjectReadMe Condition="Exists('$(MSBuildThisFileDirectory)\README.md')"> <ProjectReadMe Condition="Exists('$(MSBuildThisFileDirectory)\README.md')">
$(MSBuildThisFileDirectory)\README.md $(MSBuildThisFileDirectory)README.md
</ProjectReadMe> </ProjectReadMe>
<ProjectReadMe Condition="Exists('$(MSBuildProjectDirectory)\README.md')"> <ProjectReadMe Condition="Exists('$(MSBuildProjectDirectory)\README.md')">
$(MSBuildProjectDirectory)\README.md $(MSBuildProjectDirectory)README.md
</ProjectReadMe> </ProjectReadMe>
<ProjectReadMeExists Condition="$(ProjectReadMe) != ''">true</ProjectReadMeExists> <ProjectReadMeExists Condition="$(ProjectReadMe) != ''">true</ProjectReadMeExists>
</PropertyGroup> </PropertyGroup>
@@ -95,7 +96,6 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="OpenAPI Analyzers" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'True'"> <PropertyGroup Label="OpenAPI Analyzers" Condition="'$(UsingMicrosoftNETSdkWeb)' == 'True'">
<IncludeOpenAPIAnalyzers>true</IncludeOpenAPIAnalyzers>
<OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)/OpenApi</OpenApiDocumentsDirectory> <OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)/OpenApi</OpenApiDocumentsDirectory>
</PropertyGroup> </PropertyGroup>
@@ -130,6 +130,7 @@
<!-- Mark assemblies as CLS compliant so the compiler warns on non compliant usage --> <!-- Mark assemblies as CLS compliant so the compiler warns on non compliant usage -->
<PropertyGroup Condition="$(IsPackable) == 'true'"> <PropertyGroup Condition="$(IsPackable) == 'true'">
<ClsCompliant>true</ClsCompliant> <ClsCompliant>true</ClsCompliant>
<GenerateSBOM>true</GenerateSBOM>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<AssemblyAttribute Include="System.CLSCompliant"> <AssemblyAttribute Include="System.CLSCompliant">
@@ -145,13 +146,13 @@
</PropertyGroup> </PropertyGroup>
<!-- Use readme as nuget information --> <!-- Use readme as nuget information -->
<ItemGroup Label="Readme" Condition="$(IsPackable) == 'True' AND $(ProjectReadMe) != ''"> <ItemGroup Label="Readme" Condition="$(IsPackable) == 'True' AND $(ProjectReadMeExists) == 'True'">
<None Include="$(ProjectReadMe)" Pack="true" PackagePath="" Visible="true"/> <Content Include="$(ProjectReadMe)" PackagePath="README.md" />
</ItemGroup> </ItemGroup>
<!-- Use nuget icon --> <!-- Use nuget icon -->
<ItemGroup Label="Icon" Condition="$(IsPackable) == 'True' AND $(ProjectIconExists) == 'True'"> <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> </ItemGroup>
<!-- Uses pretty xUnit configuration --> <!-- Uses pretty xUnit configuration -->
@@ -160,6 +161,12 @@
<Content Include="$(MSBuildThisFileDirectory)\xunit.runner.json" Link="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Visible="false" /> <Content Include="$(MSBuildThisFileDirectory)\xunit.runner.json" Link="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" Visible="false" />
</ItemGroup> </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 --> <!-- Project internals are exposed to projects named $(Project).Tests by default -->
<ItemGroup <ItemGroup
Condition="@(InternalsVisibleToSuffix->Count()) == 0 AND @(InternalsVisibleTo->Count()) == 0"> Condition="@(InternalsVisibleToSuffix->Count()) == 0 AND @(InternalsVisibleTo->Count()) == 0">
@@ -200,6 +207,13 @@
</PackageReference> </PackageReference>
</ItemGroup> </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'"> <ItemGroup Label="Test Frameworks" Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="NSubstitute"/> <PackageReference Include="NSubstitute"/>
<PackageReference Include="NSubstitute.Analyzers.CSharp"> <PackageReference Include="NSubstitute.Analyzers.CSharp">
@@ -210,6 +224,7 @@
<ItemGroup Label="SourceLink" Condition="$(IsPackable) == 'true'"> <ItemGroup Label="SourceLink" Condition="$(IsPackable) == 'true'">
<SourceLinkGiteaHost Include="git.kritikos.io"/> <SourceLinkGiteaHost Include="git.kritikos.io"/>
<PackageReference Include="Microsoft.Sbom.Targets" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,11 +1,13 @@
<Project> <Project>
<ItemGroup Label="Packages"> <ItemGroup Label="Packages">
<PackageVersion Include="GitVersion.MsBuild" Version="6.4.0" /> <PackageVersion Include="GitVersion.MsBuild" Version="6.5.1" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.6" /> <PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="10.0.3" />
<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.5" />
<PackageVersion Include="NewStyleCop.Analyzers" Version="1.2.1" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" /> <PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="NSubstitute" Version="5.3.0" /> <PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="xunit.v3" Version="2.0.2" /> <PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.2" /> <PackageVersion Include="xunit.v3" Version="3.2.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -14,15 +14,16 @@
<File Path="Directory.Packages.props" /> <File Path="Directory.Packages.props" />
<File Path="dotnet.ruleset" /> <File Path="dotnet.ruleset" />
<File Path="GitVersion.yml" /> <File Path="GitVersion.yml" />
<File Path="stylecop.json" />
<File Path="xunit.runner.json" /> <File Path="xunit.runner.json" />
</Folder> </Folder>
<Folder Name="/samples/"> <Folder Name="/samples/">
<File Path="samples\Directory.Build.props" /> <File Path="samples\Directory.Build.props" />
</Folder> </Folder>
<Folder Name="/src/"> <Folder Name="/src/">
<File Path="src\Directory.build.props" /> <File Path="src\Directory.Build.props" />
</Folder> </Folder>
<Folder Name="/tests/"> <Folder Name="/tests/">
<File Path="tests\Directory.Build.props" /> <File Path="tests\Directory.Build.props" />
</Folder> </Folder>
</Solution> </Solution>

22
dotnet.ruleset Normal file
View 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
View 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
}
}
}