A personal NuGet package containing rules and analyzers to share .NET code style and configuration across multiple projects.
$ dotnet add package Kiruyuto.DotNet.ConfigPersonal set of rules and analyzers distributed as a NuGet package to share configuration across .NET projects.
Heavily based on Gérald Barré (@Meziantou)'s "Sharing coding style and Roslyn analyzers across projects" post and his CodingStandard repository.
This config contains rules changed and fine-tuned to my personal and work needs as well as preferences.
Add the NuGet package to your project, and the configs will be automatically imported.
[!IMPORTANT] It is recommended to use
Directory.Build.propsin your project over per.csprojconfiguration
.globalconfig rule configurations are located in files/ directory.props files are located in build/ directory. These are split into 'categories' for improved maintainabilityRun this command in the repository root to generate .nupkg file in local-packages/ directory:
dotnet pack Kiruyuto.DotNet.Config/Kiruyuto.DotNet.Config.csproj -c Release -o ./local-packages -p:PackageVersion=0.0.1
After that, you can add the generated package as a local source in your projects to test it out.
dotnet nuget add source "$(cygpath -w "$(pwd)/local-packages")" -n KiruyutoDotNetConfigLocal
Then run this command to check if source was added:
dotnet nuget list source
[!TIP] You can run this one-liner to do above steps at once:
dotnet pack Kiruyuto.DotNet.Config/Kiruyuto.DotNet.Config.csproj -c Release -o ./local-packages -p:PackageVersion=0.0.1 && dotnet nuget add source "$(cygpath -w "$(pwd)/local-packages")" -n KiruyutoDotNetConfigLocal && dotnet nuget list source
When you are done testing and want to remove the local source, run:
dotnet nuget remove source KiruyutoDotNetConfigLocal
See CONTRIBUTING.md for details.