Skip to content

Conditional editorconfig #66

@ADD-Eugenio-Lopez

Description

@ADD-Eugenio-Lopez

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions