msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

[Feature Request]: Expand BuildCheck editorconfig allowable syntax

Open baronfel opened this issue 1 year ago • 2 comments

Summary

EditorConfig settings for BuildChecks have rigid rules:

  • casing matters for properties
  • not all Roslyn severities are available, but the docs declare it to be so

Background and Motivation

Ease of use/things I banged my head against today

Proposed Feature

I'd like to see:

  • the IsEnabled property should support enabled as well
  • casing should be case-insensitive
  • a severity of None (also, none) should be allowed to disable a rule (this is in line with the desire for case-insensitivity)

Alternative Designs

No response

baronfel avatar Jun 13 '24 01:06 baronfel

Thank you! I'm going to update the usage, however would like clarify: which values were case sensitive? Trying to reproduce:

[*.csproj]
build_check.BC0101.IsEnabled=TRUE
build_check.BC0101.SEVERITY=ERROR

And the configuration applied correctly, am I missing something?

f-alizada avatar Jun 14 '24 07:06 f-alizada

For case sensitivity I agree that the values are fine, it was the case sensitivity of the property keys that was frustrating - convention elsewhere seems to be lowercase property keys (meaning don't let .NET's Pascal case obsession leak to the editor config file).

baronfel avatar Jun 14 '24 12:06 baronfel

Possibly related: https://github.com/dotnet/msbuild/issues/10315

JanKrivanek avatar Jul 01 '24 13:07 JanKrivanek

Btw. - the:

  • the IsEnabled property should support enabled as well
  • a severity of None (also, none) should be allowed to disable a rule (this is in line with the desire for case-insensitivity)

Are tracked as https://github.com/dotnet/msbuild/issues/10097

Let's handle in either of those tickets, let's just prevent any possible duplication of efforts

JanKrivanek avatar Jul 02 '24 08:07 JanKrivanek

Comment from @baronfel

Do we need IsEnabled overall in editorconfig if we are going to have support of severity=none which is equal to the IsEnabled=false

With this I do agree, and since we are in development mode I would remove the key from the infrastructure recognized keys :)

f-alizada avatar Jul 02 '24 08:07 f-alizada

  • the IsEnabled property should support enabled as well
  • a severity of None (also, none) should be allowed to disable a rule (this is in line with the desire for case-insensitivity)

This goal was done as part of the ticket: https://github.com/dotnet/msbuild/issues/10097

casing should be case-insensitive

Goal here is to remove the supportability of CamelCase in configuration module for infrastructure related keys and this is tracked here: https://github.com/dotnet/msbuild/issues/10315

f-alizada avatar Jul 12 '24 11:07 f-alizada

Conclusion

This issue is closed since all related work to the reported feature request is completed: 1 - https://github.com/dotnet/msbuild/issues/10315 solving the CamelCase configurations 2 - Severity model improved: https://github.com/dotnet/msbuild/issues/10097

f-alizada avatar Jul 24 '24 11:07 f-alizada