PowerShell / PowerShell/PSScriptAnalyzer
Rule request: Avoid enclosing strings with smart quotes
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.2k
- Forks
- 414
- Avg merge
- 13h 1m
- Merged PRs (30d)
- 2
Description
Background (excerpt from Wikipedea Quotation mark definition):
Regarding their appearance, there are two types of quotation marks:
- '…' and "…" are known as neutral, vertical, straight, typewriter, dumb, or ASCII quotation marks. The left and right marks are identical. These are found on typical English typewriters and computer keyboards, although they are sometimes automatically converted to the other type by software.
- ‘…’ and “…” are known as typographic, curly, curved, book, or smart quotation marks...
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the AvoidSmartQuotedString prototype in PSRules and the existing UseBOMForUnicodeEncodedFile rule documentation in PSScriptAnalyzer. Determine how a new analyzer rule is structured and tested, then define completion as detecting unintended smart-quoted strings without producing a misleading BOM warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100