Skip to content

[BuildCheck] Editor config support#9811

Merged
f-alizada merged 67 commits into
mainfrom
dev/f-alizada/support-editorconfig
May 20, 2024
Merged

[BuildCheck] Editor config support#9811
f-alizada merged 67 commits into
mainfrom
dev/f-alizada/support-editorconfig

Conversation

@f-alizada

@f-alizada f-alizada commented Mar 1, 2024

Copy link
Copy Markdown
Contributor

First iteration of the code with latest merged changes from exp/build-analyzers.

Design capturing current implementation could be viewed here: https://github.com/dotnet/msbuild/tree/dev/f-alizada/support-editorconfig/src/Build/BuildCheck/Infrastructure/EditorConfig

Discussions:

Current implementation.
The editorConfig parsing functionality is being used by https://github.com/dotnet/msbuild/blob/dev/f-alizada/support-editorconfig/src/Build/BuildCheck/Infrastructure/ConfigurationProvider.cs
to fetch all configs from .editorconfig.

  • Add comments on all public APIs
  • Check the case sensitive key-values in cache
  • Manual testing
    • unix
    • windows

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First quick pass. Looks good! :-)
Though I'd love to see my static leftover being turned into mockable interface

I haven't reviewed the copied files though... (hopefully we'll anyways end up consuming a shared version from Roslyn)

Comment thread src/Build/BuildCop/API/BuildAnalyzerConfiguration.cs Outdated
Comment thread src/Build/BuildCop/API/BuildAnalyzerConfiguration.cs Outdated
Comment thread src/Build/BuildCop/Infrastructure/ConfigurationProvider.cs Outdated
Comment thread src/Build/BuildCop/Infrastructure/EditorConfig/IEditorConfigParser.cs Outdated
Comment thread src/Build/BuildCop/Infrastructure/EditorConfig/EditorConfigParser.cs Outdated

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added couple additional comments

Comment thread src/Analyzers.UnitTests/BuildAnalyzerConfiguration_Test.cs Outdated
Comment thread src/Analyzers.UnitTests/BuildAnalyzerConfiguration_Test.cs Outdated
Comment thread src/Analyzers.UnitTests/EditorConfig_Tests.cs Outdated
Comment thread src/Build/BuildCop/Infrastructure/ConfigurationProvider.cs Outdated
Comment thread src/Build/BuildCop/Infrastructure/ConfigurationProvider.cs Outdated
Comment thread src/Build/BuildCop/Infrastructure/ConfigurationProvider.cs Outdated
@rainersigwald

Copy link
Copy Markdown
Member

Design capturing current implementation could be viewed here: https://github.com/dotnet/msbuild/tree/dev/f-alizada/support-editorconfig/src/Build/BuildCop/Infrastructure/EditorConfig

Can you add to this doc some details about what the exposed interface to this stuff is? That is, what interfaces/whatever MSBuild code will be using to learn about editorconfig-driven configuration?

Also, does this PR introduce the patterns that we'll use to map (stuff in the .editorconfig) to (severity for rules), or is that coming later?

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed latest state - looks goot to go for initial version!

Comment thread src/Build/BuildCheck/Infrastructure/BuildCheckConfigurationException.cs Outdated
Comment thread src/Analyzers.UnitTests/EndToEndTests.cs Outdated
@f-alizada

f-alizada commented Mar 19, 2024

Copy link
Copy Markdown
Contributor Author

Can you add to this doc some details about what the exposed interface to this stuff is? That is, what interfaces/whatever MSBuild code will be using to learn about editorconfig-driven configuration?

Added example of the usage (API) and what it returns.

Also, does this PR introduce the patterns that we'll use to map (stuff in the .editorconfig) to (severity for rules), or is that coming later?

The PR introduced both -> .editorconfig parsing and mapping the configuration to the actual rules

@f-alizada f-alizada requested a review from JanKrivanek April 26, 2024 13:12

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haver couple comments for consideration - but overall looks good!

Comment thread src/Build/BuildCheck/API/BuildAnalyzerConfiguration.cs Outdated
Comment thread src/Build/BuildCheck/API/BuildAnalyzerConfiguration.cs Outdated
Comment thread src/Build/BuildCheck/API/BuildAnalyzerConfiguration.cs
Comment thread src/Build/BuildCheck/Infrastructure/BuildCheckConfigurationErrorScope.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/ConfigurationProvider.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/EditorConfig/EditorConfigParser.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/CustomConfigurationData.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/EditorConfig/README.md
@f-alizada f-alizada requested a review from JanKrivanek April 28, 2024 10:42
@f-alizada f-alizada changed the title Editor config init [BuildCheck] Editor config support Apr 28, 2024

@JanKrivanek JanKrivanek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thnak you for all the improvement roundtrips on the PR!

Comment thread src/Build/BuildCheck/API/ConfigurationContext.cs
Comment thread src/Build/BuildCheck/Infrastructure/EditorConfig/README.md

@ladipro ladipro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Comment thread src/Build/BuildCheck/Infrastructure/CustomConfigurationData.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/EditorConfig/EditorConfigParser.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/EditorConfig/README.md Outdated
Comment thread src/BuildCheck.UnitTests/EditorConfigParser_Tests.cs Outdated
Comment thread src/Build/BuildCheck/Infrastructure/ConfigurationProvider.cs Outdated
@f-alizada f-alizada merged commit 352851b into main May 20, 2024
@f-alizada f-alizada deleted the dev/f-alizada/support-editorconfig branch May 20, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants