Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GoodEnoughRules/Public/Measure-GremlinCharacter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ function Measure-GremlinCharacter {
[char]0x200B = @{ Description = 'zero width space'; Severity = 'Error' }
[char]0x200C = @{ Description = 'zero width non-joiner'; Severity = 'Warning' }
[char]0x200E = @{ Description = 'left-to-right mark'; Severity = 'Error' }
[char]0x2011 = @{ Description = 'non-breaking hyphen'; Severity = 'Warning' }
[char]0x2012 = @{ Description = 'figure dash'; Severity = 'Warning' }
[char]0x2013 = @{ Description = 'en dash'; Severity = 'Warning' }
[char]0x2014 = @{ Description = 'em dash'; Severity = 'Warning' }
[char]0x2018 = @{ Description = 'left single quotation mark'; Severity = 'Warning' }
[char]0x2019 = @{ Description = 'right single quotation mark'; Severity = 'Warning' }
[char]0x201C = @{ Description = 'left double quotation mark'; Severity = 'Warning' }
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/Measure-GremlinCharacter.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Severity levels reflect how dangerous the character is:

- **Error** - Bidirectional overrides, zero-width spaces, and control characters
that can actively obscure code intent or enable Trojan-source attacks.
- **Warning** - Typographic characters (curly quotes, en dash) that are unlikely
- **Warning** - Typographic characters (curly quotes, non-breaking hyphen, figure dash, en dash, em dash) that are unlikely
to be intentional in source code and may cause parse errors.
- **Information** - Characters like non-breaking spaces that are rarely intentional
but generally harmless.
Expand Down
3 changes: 3 additions & 0 deletions tests/Measure-GremlinCharacter.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
@{ Char = [char]0x200B; CodePoint = '200B'; Description = 'zero width space'; Severity = 'Error' }
@{ Char = [char]0x200C; CodePoint = '200C'; Description = 'zero width non-joiner'; Severity = 'Warning' }
@{ Char = [char]0x200E; CodePoint = '200E'; Description = 'left-to-right mark'; Severity = 'Error' }
@{ Char = [char]0x2011; CodePoint = '2011'; Description = 'non-breaking hyphen'; Severity = 'Warning' }
@{ Char = [char]0x2012; CodePoint = '2012'; Description = 'figure dash'; Severity = 'Warning' }
@{ Char = [char]0x2013; CodePoint = '2013'; Description = 'en dash'; Severity = 'Warning' }
@{ Char = [char]0x2014; CodePoint = '2014'; Description = 'em dash'; Severity = 'Warning' }
@{ Char = [char]0x2018; CodePoint = '2018'; Description = 'left single quotation mark'; Severity = 'Warning' }
@{ Char = [char]0x2019; CodePoint = '2019'; Description = 'right single quotation mark'; Severity = 'Warning' }
@{ Char = [char]0x201C; CodePoint = '201C'; Description = 'left double quotation mark'; Severity = 'Warning' }
Expand All @@ -34,7 +37,7 @@
@{ Char = [char]0x202C; CodePoint = '202C'; Description = 'pop directional formatting'; Severity = 'Error' }
@{ Char = [char]0x202D; CodePoint = '202D'; Description = 'left-to-right override'; Severity = 'Error' }
@{ Char = [char]0x202E; CodePoint = '202E'; Description = 'right-to-left override'; Severity = 'Error' }
@{ Char = [char]0xFFFC; CodePoint = 'FFFC'; Description = 'object replacement character'; Severity = 'Error' }

Check warning on line 40 in tests/Measure-GremlinCharacter.tests.ps1

View workflow job for this annotation

GitHub Actions / ci / Run Linters

Unknown word (FFFC) Suggestions: (fac, fcc, FCC, fec, fmc)
) {
$fakeScript = "Write-Host '${Char}hello'"
$tokens = $null
Expand Down
Loading