Skip to content
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

Rule request: Avoid surrounding strings with smart quotes #1936

Open
iRon7 opened this issue Aug 29, 2023 · 2 comments
Open

Rule request: Avoid surrounding strings with smart quotes #1936

iRon7 opened this issue Aug 29, 2023 · 2 comments

Comments

@iRon7
Copy link

iRon7 commented Aug 29, 2023

Summary of the new feature

Quoted strings are sometimes unintendedly replaced when passed by word processors as Microsoft Office applications as MSWord and Outlook. It is recommended to surround strings with unambiguous single quoted or double quoted string as it unnecessary triggers the UseBOMForUnicodeEncodedFile rule with no clear indication of the location.

Proposed technical implementation details (optional)

See (PowerShell based) prototype AvoidSmartQuotedString at: https://github.com/iRon7/PSRules

What is the latest version of PSScriptAnalyzer at the point of writing

1.21.0

@SydneyhSmith
Copy link
Collaborator

Thanks @iRon7 I am going to open this up as a discussion and see if other folks have scenarios that would need this, PowerShell manages smart quotes quite well today

@iRon7
Copy link
Author

iRon7 commented Aug 30, 2023

@SydneyhSmith,

Thanks for picking this up as a discussion

PowerShell manages smart quotes quite well today

Agree but just like e.g. the AvoidTrailingWhitespace rule, you better avoid them.

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

2 participants