Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix PSUseConsistentIndentation.PipelineIndentation.None to not remove code when the previous line ended with a pipe#1746

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JamesWTruher merged 2 commits intoPowerShell:masterfrombergmeister:fix_1580
May 24, 2022

Conversation

@bergmeister
Copy link
Collaborator

PR Summary

Fixes#1580 by resetting the newline in the case of the first token after a pipeline and newline lands in thedefault switch statement. It seems the existing test case was too simple.

PR Checklist

@bergmeisterbergmeister marked this pull request as ready for reviewNovember 13, 2021 19:20
Copy link
Member

@andyleejordanandyleejordan left a comment

Choose a reason for hiding this comment

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

Thank you for working on this@bergmeister. I'm wondering if we need a few more tests?#1580 provided several examples, and also pointed out that this issue occurs with bothNone and strangely a setting of3. What do you think?

I can spend some time to manually test this if you'd like and perhaps come up with more test coverage.

@bergmeister
Copy link
CollaboratorAuthor

bergmeister commentedNov 22, 2021
edited
Loading

Yes, testing is always a challenge. It's a compromise between doing lots of integration tests or complex code and maintaining all the test cases if a change necessitates updating expectations. Definitely happy to add more test cases or something more complex, do you have something specific in mind? Otherwise my suggestions is to dog food the local build with this setting.
With regards to the repro also working for3, this is in fact the same setting, it is just the enum representation of it:

[ConfigurableRuleProperty(defaultValue:"IncreaseIndentationForFirstPipeline")]
publicstringPipelineIndentation
{
get
{
returnpipelineIndentationStyle.ToString();
}
set
{
if(String.IsNullOrWhiteSpace(value)||
!Enum.TryParse(value,true,outpipelineIndentationStyle))
{
pipelineIndentationStyle=PipelineIndentationStyle.IncreaseIndentationForFirstPipeline;
}
}
}
privateboolinsertSpaces;
privatecharindentationChar;
privateintindentationLevelMultiplier;
// TODO Enable auto when the rule is able to detect indentation
privateenumIndentationKind{
Space,
Tab,
// Auto
};
privateenumPipelineIndentationStyle
{
IncreaseIndentationForFirstPipeline,
IncreaseIndentationAfterEveryPipeline,
NoIndentation,
None
}

Copy link
Member

@andyleejordanandyleejordan left a comment

Choose a reason for hiding this comment

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

With regards to the repro also working for 3, this is in fact the same setting, it is just the enum representation of it:

Gotcha! In that case, I'll defer to your judgement. Looks good to me!

@JamesWTruherJamesWTruher merged commit4890939 intoPowerShell:masterMay 24, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@andyleejordanandyleejordanandyleejordan approved these changes

+1 more reviewer

@JamesWTruherJamesWTruherJamesWTruher approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

PSUseConsistentIndentation.PipelineIndentation.None or3 deletes commandlet name

3 participants

@bergmeister@andyleejordan@JamesWTruher

[8]ページ先頭

©2009-2025 Movatter.jp