DotNetAnalyzers / StyleCopAnalyzers

An implementation of StyleCop rules using the .NET Compiler Platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to have multiple (hierarchical) configuration files

alexrp opened this issue · comments

I have a .stylecop.json file that is shared across my GitHub organization. I store it in my .github repository and use dotnet-file to synchronize it across the organization whenever it changes.

This is a pretty convenient setup, but it runs into a small problem: Not all repositories are necessarily under the same license. This means that the file header configuration (containing SPDX-License-Identifier) must be different in some repositories, which in turn defeats this whole synchronization scheme.

It would be nice if there was a way to specify multiple configuration files in a hierarchical way, such that I can have all the shared configuration in the .github repository as it is now, but also configure the file header settings in a small extra configuration file that isn't synchronized.

You can place shared default values in a .globalconfig file, which will be overridden by stylecop.json.

Ah, I wasn't aware that the analyzers pick up those properties from EditorConfig. That satisfies the use case for this feature request then, thanks!