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

Prevent PSCloseBrace crash if hashtable definition start on first token and there is a PSCloseBrace violation#1235

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

Conversation

@bergmeister
Copy link
Collaborator

PR Summary

Fixes#1219

PR Checklist

Copy link
Contributor

@rjmholtrjmholt left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@JamesWTruherJamesWTruher left a comment

Choose a reason for hiding this comment

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

I'm not sure the call toInvoke-Formatter belongs in line 107

}

It"Should not crash when hashtable is defined on first token" {
$def=@'
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can also be written as follows:

$def = "@{ `n Key = 1 }"

and it will cause the same error

bergmeister reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

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

and it's a very specific set of characters. This"@{key=1}" doesn't cause the problem but"@{``nkey=1}" does

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Ok, I can change it to that

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Done now


$violations=Invoke-ScriptAnalyzer-ScriptDefinition$def-Settings$settings-ErrorAction Stop
$violations.Count| Should-Be1
Invoke-Formatter-ScriptDefinition$def-ErrorAction Stop
Copy link
Contributor

Choose a reason for hiding this comment

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

There doesn't seem to be an assertion here. Since the formatter uses the same rule, this seems superfluous. (do you want an explicit test for the formatter?)

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

The assertion here is that the formatter does not throw an exception. The call toInvoke-ScriptAnalyzer is the core unit test but the call toInvoke-Formatter is the integration test.

@JamesWTruherJamesWTruher merged commitc3f2a20 intoPowerShell:developmentJun 6, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@rjmholtrjmholtrjmholt approved these changes

@JamesWTruherJamesWTruherJamesWTruher approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Problem with formatting Hash

3 participants

@bergmeister@rjmholt@JamesWTruher

[8]ページ先頭

©2009-2025 Movatter.jp