Skip to content

Linting for when a backtick is followed only by white space #423

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AndrewGaspar opened this issue Jan 6, 2016 · 5 comments
Closed

Linting for when a backtick is followed only by white space #423

AndrewGaspar opened this issue Jan 6, 2016 · 5 comments

Comments

@AndrewGaspar
Copy link
Contributor

Moved from PowerShell/vscode-powershell#69


I've been bitten by this bug a few times:

$oven = Toast-Bread ` 
    -Bread Wheat

You probably can't see the problem - there's a space after the backtick, which causes the parser not to take the next line as part of the command, causing the command to be issued without the Bread parameter. It would be great if vscode-powershell highlighted this issue because I'm sure it's almost never done intentionally.

This seems to be a PowerShell problem generally - why isn't a backtick followed only by white space and a newline handled the same as a backtick immediately followed by a newline?

@daviwil
Copy link
Contributor

daviwil commented Jan 6, 2016

Related conversation: #218

@joeyaiello
Copy link
Contributor

Yeah, this makes a lot of sense to me as a warning.

Is everyone onboard with warning as the severity level? If you really intend to escape a space, add a SuppressMessage attribute.

@daviwil
Copy link
Contributor

daviwil commented Jan 7, 2016

Or maybe make the rule scoped to backticks followed by arbitrary whitespace and a newline

@joeyaiello
Copy link
Contributor

Good point.

@raghushantha
Copy link
Member

Andrew added the new rule!
#425

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

No branches or pull requests

4 participants