Skip to content

Move some severity configurations to globalconfig - #65274

Merged
333fred merged 6 commits into
dotnet:mainfrom
Youssef1313:globalconfig
Jan 19, 2023
Merged

333fred merged 6 commits into
dotnet:mainfrom
Youssef1313:globalconfig

Conversation

@Youssef1313

@Youssef1313 Youssef1313 commented Nov 8, 2022 •

Copy link
Copy Markdown
Member

@Youssef1313
Youssef1313 requested a review from a team as a code owner November 8, 2022 13:02
@ghost ghost added Community The pull request was submitted by a contributor who is not a Microsoft employee. Area-Infrastructure labels Nov 8, 2022
@Youssef1313
Youssef1313 force-pushed the globalconfig branch 3 times, most recently from a14de84 to 8715275 Compare November 8, 2022 14:48
@333fred

333fred commented Nov 9, 2022

Copy link
Copy Markdown
Member

@Youssef1313 can you add a description? What is this PR supposed to accomplish?

@Youssef1313

Copy link
Copy Markdown
Member Author

@Youssef1313 can you add a description? What is this PR supposed to accomplish?

Use of globalconfigs was something recommended by @sharwell as being more efficient (see dotnet/aspnetcore#30138 (comment)), I don't know why it is more efficient though.

Comment thread .editorconfig
Comment on lines -292 to -300
# dotnet_style_allow_statement_immediately_after_block_experimental
dotnet_diagnostic.IDE2003.severity = warning

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This has no effect 😕

The corresponding code-style option default value is true which means "disable the analyzer":

var option = context.GetAnalyzerOptions().AllowStatementImmediatelyAfterBlock;
if (option.Value)
return;

I guess it's not intentional, @CyrusNajmabadi ?

@333fred

333fred commented Nov 9, 2022

Copy link
Copy Markdown
Member

Use of globalconfigs was something recommended by @sharwell as being more efficient (see dotnet/aspnetcore#30138 (comment)), I don't know why it is more efficient though.

We'll need that answered :).

@333fred
333fred marked this pull request as draft November 9, 2022 19:42
@333fred

333fred commented Nov 9, 2022

Copy link
Copy Markdown
Member

Marking as draft pending a more complete description of what this solves.

@Youssef1313

Copy link
Copy Markdown
Member Author

@sharwell Can you advise here?

@sharwell

sharwell commented Nov 15, 2022 •

Copy link
Copy Markdown
Contributor

.globalconfig only needs to be evaluated once for a project, while .editorconfig needs to be evaluated for each document (in practice it behaves better than a complete evaluation for each document). @mavasani can describe what optimizations are applied regarding enabling/disabling analyzers when the configuration is provided for the entire project.

@Youssef1313
Youssef1313 marked this pull request as ready for review November 16, 2022 05:57
@Youssef1313

Copy link
Copy Markdown
Member Author

@333fred Should this be ready to merge?

Comment thread .editorconfig
csharp_preserve_single_line_statements = true

# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = warning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 This moved from *.cs to *.*. The VB code will need to be updated to fix the new warnings.

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.

@Youssef1313 I don't think we should make this change as part of this PR. Please move *.cs things back to just *.cs, and revert the VB changes.

@Youssef1313
Youssef1313 requested a review from a team as a code owner November 29, 2022 19:01
@Youssef1313

Copy link
Copy Markdown
Member Author

@333fred Can we get this merged? Thanks!

@333fred

333fred commented Jan 18, 2023

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@333fred
333fred enabled auto-merge (squash) January 19, 2023 00:03
@333fred
333fred merged commit 115bc6b into dotnet:main Jan 19, 2023
@ghost ghost added this to the Next milestone Jan 19, 2023
@Youssef1313
Youssef1313 deleted the globalconfig branch January 19, 2023 04:50
@Cosifne Cosifne modified the milestones: Next, 17.6 P1 Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Infrastructure Community The pull request was submitted by a contributor who is not a Microsoft employee.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants