editorconfig / editorconfig-visualstudio

EditorConfig Visual Studio Addin
http://editorconfig.org
Other
352 stars 74 forks source link

Conditional editorconfig #66

Open ADD-Eugenio-Lopez opened 2 years ago

ADD-Eugenio-Lopez commented 2 years ago

We are trying to conditionally add an editoconfig to our projects. Our first idea was the possibility of adding the editorconfig at the project level under an MSBuild variable. If the condition was met, the editorconfig file (located in another folder) was added as a link to the project.

Example of adding editorconfig at the project level on demand:

<ItemGroup Condition=” $(AnalyzeAutoGeneratedCode) == ‘true’ “>

Since it doesn't work at the project level, we thought we'd add the editorconfig at the solution level. The problem is that we don't know how to add it conditionally.

Our intention would be to include an editorconfig file at the solution level that contains these exclusions, but that depends on some MSBuild variable to be able to configure it according to the needs of the programmers:

If (someVariable) # this code is the one we would like to add. [/fakes/.cs] dotnet_diagnostic.S1128.severity = none dotnet_diagnostic.cs1591.severity = none endif # this code is the one we would like to add.

Is there any way to do this?