Skip to content

Use new formatting options in roslyn itself.#53957

Merged
CyrusNajmabadi merged 47 commits intodotnet:mainfrom
CyrusNajmabadi:formattingOptions
Jun 15, 2021
Merged

Use new formatting options in roslyn itself.#53957
CyrusNajmabadi merged 47 commits intodotnet:mainfrom
CyrusNajmabadi:formattingOptions

Conversation

@CyrusNajmabadi
Copy link
Contributor

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from jmarolf June 8, 2021 22:59
@CyrusNajmabadi CyrusNajmabadi requested review from a team as code owners June 8, 2021 22:59
@ghost ghost added the Area-IDE label Jun 8, 2021
Copy link
Contributor

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

  • Need to reference stable package version (cc @JoeRobich)
  • Have we verified that 16.10 is listed as the minimum supported development version?

@sharwell sharwell marked this pull request as draft June 8, 2021 23:13
dotnet_diagnostic.RS0102.severity = none

# IDE0059: Unnecessary assignment to a value
dotnet_diagnostic.IDE0059.severity = none
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was unfortunate. but without this the compiler had tons of warnings here that touched a lot of core code. i think we should take a followup PR that enables this in isolation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sharwell @jcouv for thoughts on this. I really don't like the idea of disabling this (as i think it reveals many interesting cases where the code seems fishy). But i don't want to have this PR go in witha bunch of complex code changes that have to be closely reviewed and which carries the risk of a subtle bug being introduced.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is IDE0059 new for 3.10? I throught we disabled it for the compiler code a long time ago.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure. @mavasani ? The diagnostics look appropriate. But there are a lot of them and I don't think we should do this without explicit compiler desire ahead of time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mavasani any ideas here?

Copy link
Contributor

Choose a reason for hiding this comment

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

but without this the compiler had tons of warnings

This cannot be correct. Our editorconfig does not set IDE0059 to warning for the compiler folder.

@CyrusNajmabadi CyrusNajmabadi requested review from jcouv and sharwell June 9, 2021 15:03
dotnet_diagnostic.IDE2001.severity = none
dotnet_diagnostic.IDE2002.severity = none
dotnet_diagnostic.IDE2003.severity = none
dotnet_diagnostic.IDE2004.severity = none
Copy link
Contributor Author

Choose a reason for hiding this comment

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

compiler was disabling the RS.... diagnostics above. It seems liek a pity, but i think we have to do the same with the IDE2XXX diagnostics until we can decide if we want to be consistent here across the codebase or not.

{
bool isNoPiaLocalType;
return _metadataDecoder.GetSymbolForTypeHandleOrThrow(handle, out isNoPiaLocalType, allowTypeSpec: true, requireShortForm: false);
return _metadataDecoder.GetSymbolForTypeHandleOrThrow(handle, out _, allowTypeSpec: true, requireShortForm: false);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the EE is not under the compiler and doesn't ahve its own editorconfig. So i did fix these all up. THere were few enough cases that i felt ok doing this.

expr: "this.get_P()",
resultProperties: out resultProperties,
resultProperties: out _,
error: out error);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

most fixes were in tests.

.editorconfig Outdated
dotnet_diagnostic.IDE2000.severity = warning

dotnet_style_allow_statement_immediately_after_block_experimental = true:none
dotnet_diagnostic.IDE2003.severity = none
Copy link
Contributor Author

Choose a reason for hiding this comment

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

would like to set this to 'false'. but will come in a followup PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we set it to false:suggestion for this PR, and just not fix the current reports yet?

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review June 15, 2021 16:58
@CyrusNajmabadi CyrusNajmabadi requested review from a team as code owners June 15, 2021 16:58
@CyrusNajmabadi
Copy link
Contributor Author

@sharwell does thsi need anything else (other than reviews of course) to be able to move forward?

@CyrusNajmabadi CyrusNajmabadi requested a review from sharwell June 15, 2021 18:35
@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) June 15, 2021 18:41
@CyrusNajmabadi CyrusNajmabadi merged commit 6b93b0c into dotnet:main Jun 15, 2021
@ghost ghost added this to the Next milestone Jun 15, 2021
@RikkiGibson RikkiGibson modified the milestones: Next, 17.0.P2 Jun 29, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the formattingOptions branch September 30, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants