Skip to content

Enable SA1000: Keywords should be spaced correctly - #13973

Merged
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
xtqqczze:SA1000
Nov 30, 2020
Merged

Enable SA1000: Keywords should be spaced correctly#13973
Ilya (iSazonov) merged 1 commit into
PowerShell:masterfrom
xtqqczze:SA1000

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Nov 2, 2020

Copy link
Copy Markdown
Contributor

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 6, 2020
@ghost ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Nov 10, 2020
@ghost ghost removed the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Nov 18, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

Still draft?

@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Ilya (@iSazonov) Please review and merge.

@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Nov 30, 2020
@@ -113,7 +113,7 @@ private void SetResumeResponseHeaders()
private bool TryGetRangeHeader(out string rangeHeader)
{
var rangeHeaderSv = new StringValues();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

xtqqczze For my education - does an analyzer recognize the "var" pattern to convert to

            StringValues rangeHeaderSv = new();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am not aware of such an analyzer, but one could use RCS1012 codefix first.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So we should apply RCS1012 and then apply a fix to the new pattern?

@iSazonov
Ilya (iSazonov) merged commit db94377 into PowerShell:master Nov 30, 2020
@ghost ghost removed the Review - Needed The PR is being reviewed label Nov 30, 2020
@iSazonov Ilya (iSazonov) added this to the 7.2.0-preview.2 milestone Nov 30, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

I'm seeing warnings on the following pattern in live analysis, I'm surprised CI did not fail:

SA1000: The keyword 'new' should be followed by a space.

This issue was fixed in DotNetAnalyzers/StyleCopAnalyzers#3187, and is in the v1.2.0-beta.261 release.

@iSazonov

Copy link
Copy Markdown
Collaborator

I'm surprised CI did not fail:

CI makes clean loading packages. So I guess if you see the warning you need clean your local package cache.

@xtqqczze

Copy link
Copy Markdown
Contributor Author

I'm surprised CI did not fail:

CI makes clean loading packages. So I guess if you see the warning you need clean your local package cache.

CI is now failing

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Steve Lee (@SteveL-MSFT) Travis Plunk (@TravisEz13) those build errors are coming from files I haven't touched in this PR. Not sure what's up there, I'm guessing something got merged that for some reason managed not to trigger the build errors but should have?

Yeah I'm not able to build this branch locally either.

Looks like it's coming from these, but checks for those PRs passed.

Looking into how best to fix (and ideally prevent from reoccurring).

/cc Ilya (@iSazonov)

Originally posted by Rob Holt (@rjmholt) in #9900 (comment)

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Between tests for this PR passing (12 days ago), we merged IDE0090 PRs, which conflicted as the version of StyleCopAnalyzers in use at the time did not support target-typed new expressions properly.

We could reduce the likelihood of similar issues occurring again by running tests again between approval and merge.

@iSazonov

Copy link
Copy Markdown
Collaborator

We could reduce the likelihood of similar issues occurring again by running tests again between approval and merge.

Ah, clear! We catch this again :-)

@xtqqczze
xtqqczze deleted the SA1000 branch December 1, 2020 08:44
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants