Rule request: Avoid enclosing strings with smart quotes
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 45/100
Rechercherichtung
Beginne damit, den Prototyp AvoidSmartQuotedString in PSRules und die bestehende Dokumentation der Regel UseBOMForUnicodeEncodedFile in PSScriptAnalyzer zu lesen. Ermittle, wie eine neue Analyserregel strukturiert und getestet wird, und definiere anschließend die Fertigstellung so, dass unbeabsichtigte typografische Anführungszeichen in Zeichenfolgen erkannt werden, ohne eine irreführende BOM-Warnung auszugeben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- C#
- Sterne
- 2.2k
- Forks
- 415
- Ø Merge
- 13 Std. 1 Min.
- Gemergte PRs (30 T.)
- 2
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
PowerShell/PSScriptAnalyzer#2217 · 1 Kommentar ·
-
PSUseConsistentIndentation double-indents attribute bodies that open a scriptblock (`[Attr({ … })]`) Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 70/100
PowerShell/PSScriptAnalyzer#2216 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
PowerShell/PSScriptAnalyzer#2211 ·
-
`PSPlaceOpenBrace` and `PSPlaceCloseBrace` leave trailing whitespace when expanding one-line blocks Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 70/100
PowerShell/PSScriptAnalyzer#2210 ·
Alle Issues in PowerShell/PSScriptAnalyzer
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
nightscout/nocturne#1425 ·
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Schwierigkeit 2/5 1-2 Tage Anfängerfreundlichkeit 75/100
Altinn/altinn-auth#4143 ·