Skip to content

Add a linter warning for special quote characters #1880

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
2 tasks done
notgriffin opened this issue Jan 9, 2023 · 6 comments
Closed
2 tasks done

Add a linter warning for special quote characters #1880

notgriffin opened this issue Jan 9, 2023 · 6 comments

Comments

@notgriffin
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

Users who copy and paste code may inadvertently grab special quote characters and not normal quote characters. The linter should warn that special quotes were used to surround a string. Otherwise the code will likely error out.

Proposed Design

Add a linting rule to warn when special quote characters are used to surround a string

@ghost ghost added the Needs: Triage 🔍 label Jan 9, 2023
@andyleejordan andyleejordan transferred this issue from PowerShell/vscode-powershell Jan 9, 2023
@StevenBucher98
Copy link
Collaborator

Thanks for the issue @notgriffin! Do you want " as the default normal quote character? Or maybe this enhancement can allow you to choose which one is correct

@StevenBucher98
Copy link
Collaborator

@notgriffin Was this something you had a problem with? The PowerShell parser does some work to help manage the different quote characters.

@notgriffin
Copy link
Author

Hi @StevenBucher98! Yes the " U+0022 and/or ' U+0027 should be the default quote character. This was something I had a problem with where the linter did not flag this as an issue even though it was causing code issues. The linter I think should not error on any of the following unicode character values when quoting a string: U+201C, U+201D, U+201F, U+2019, U+301D, U+301E, U+301F, U+FF02, U+201A, U+2018, U+201B, U+2758, or U+275C.

@bergmeister
Copy link
Collaborator

The specific input is useful but me it feels like issue #1436 already covers this

@notgriffin
Copy link
Author

Yeah I guess it covers it to come degree, although I think that issue should then be expanded to include the characters I specified above.

@bergmeister
Copy link
Collaborator

yes, that's what I meant by 'your specific is useful', can you comment this on the other issue please and we close this as a duplicate?

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

3 participants