Distributes a shared .editorconfig file containing the rules we use on Ghyston projects.
$ dotnet add package Ghyston.editorconfigThe purpose of this package is to distribute a shared .editorconfig file, and have a single source of truth for which
rules we use on our projects. It is intended to be used alongside CSharpier, so most of the
formatting rules have been disabled.
It's not possible for a .editorconfig file to be referenced/extended from a NuGet package, so we take the approach of
copying the .editorconfig file into the project at build time.
A lot of the rules come from StyleCop.Analyzers, which needs to be installed separately.
You can view the default .editorconfig file here.
.editorconfig file in the project root (the same folder as your .csproj).
Note that this will overwrite any existing .editorconfig file..editorconfig file from git, by adding /*/.editorconfig to your .gitignore
(assuming you only want to ignore the .editorconfig files one level below the git root, which is usually where your
.csproj files are)dotnet format style --verify-no-changesdotnet format analyzers --verify-no-changesIf you need to make any edits to the generated .editorconfig file, you can create an .editorconfig.overrides file at
your project root, and the contents of this file will be appended to the generated .editorconfig file.
You can find the .editorconfig file in the GhystonEditorconfig folder.
To test this package, you need to build it locally and install it in a project.
GhystonEditorconfig/GhystonEditorconfig.csproj to something like
<Version>1.0.0-re-$([System.DateTime]::Now.ToString('yyyyMMddHHmm'))</Version>dotnet build --configuration Releasedotnet pack
.nupkg file at GhystonEditorconfig\bin\ReleaseGhystonEditorconfig\bin\Release folder as a NuGet package sourcedotnet nuget push GhystonEditorconfig\bin\Release\Ghyston.editorconfig.x.y.z.nupkg --source https://api.nuget.org/v3/index.json --api-key YOUR_API_KEY
x.y.z, and swap YOUR_API_KEY for your api key