Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration hierarchical composability #10954

Open
JanKrivanek opened this issue Nov 8, 2024 · 0 comments
Open

Configuration hierarchical composability #10954

JanKrivanek opened this issue Nov 8, 2024 · 0 comments
Labels
needs-design Requires discussion with the dev team before attempting a fix. Priority:2 Work that is important, but not critical for the release triaged

Comments

@JanKrivanek
Copy link
Member

JanKrivanek commented Nov 8, 2024

Context

Analogy to Roslyn globalconfigs asked by couple users during initial demos.
Being able to set 'policies' centrally via package is currently missing.

Possible goals

  • Being able to set different (additive) configs on different levels (e.g. rule with whitelist allows additive configuration of whitelist, insted hiding the higher level setting)
  • Unlocks ability to ship default configurations

Example of usage

  • A theoretical buildcheck ForbidSettingUnderscoreProperty, that will flag assigning to the property starting with underscore
  • The buildcheck will have a whitelist setting (settable via .editorconfig) to allow exceptions
  • Someone would like to set a whitelist for the check on the scope of whole repository in the root of the repo with .editorconfig:
microsoft.buildcheck.AB1234.whitelist=_propA,_propB
  • We then would want to add additional whitelist for a subsection of repo (or a specific project), but without overwriting the higher scope settings. So e.g.:
microsoft.buildcheck.AB1234.whitelist=_propC

would allow the whitelists to be joined

The actual implementation and exposing would need to be designed and thought through (e.g. should the additivity be explicitly opt-ed in in the .editorconfig, the Checks might then receive enumeration of setting per single key)

The additional scenario that this then unlocks is: "Can we create and distribute .editorconfig file via nuget packages, so that users can apply it and get preconfigured behavior as a base for their build" - this is not possible today, as only .editorconfig files in the code hierarchy are being recognized (obj and nuget cache are ignored). This would need design as well (what is the priority, opt-in/out, etc.)

@maridematte maridematte added triaged gathering-feedback The issue requires feedback in order to be planned, please comment if the feature is useful for you Area: BuildCheck labels Nov 18, 2024
@JanKrivanek JanKrivanek added needs-design Requires discussion with the dev team before attempting a fix. and removed triaged gathering-feedback The issue requires feedback in order to be planned, please comment if the feature is useful for you Area: BuildCheck labels Nov 18, 2024
@maridematte maridematte added Priority:2 Work that is important, but not critical for the release triaged labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-design Requires discussion with the dev team before attempting a fix. Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

2 participants