Skip to content

Measure-GremlinCharacter: detect U+2011/U+2012/U+2014 dash gremlins - #14

Merged
HeyItsGilbert merged 1 commit into
mainfrom
copilot/update-measure-gremlincharacter-rule
Aug 26, 2026
Merged

Measure-GremlinCharacter: detect U+2011/U+2012/U+2014 dash gremlins#14
HeyItsGilbert merged 1 commit into
mainfrom
copilot/update-measure-gremlincharacter-rule

Conversation

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Measure-GremlinCharacter currently catches several deceptive Unicode punctuation characters but misses three dash variants that can silently alter script text. This update adds detection for em dash, figure dash, and non-breaking hyphen with the same warning posture used for nearby typographic punctuation.

  • Rule updates

    • Added the following entries to the ordered gremlin map in Measure-GremlinCharacter:
      • U+2011 — non-breaking hyphen
      • U+2012 — figure dash
      • U+2014 — em dash
    • Assigned Warning severity for all three to align with existing punctuation-like deceptive characters (e.g., en dash, curly quotes).
    • Kept existing diagnostic emission behavior unchanged, including message format:
      • Gremlin character found: U+XXXX (<description>). This character may be invisible or visually deceptive.
  • Test coverage

    • Extended the table-driven cases in tests/Measure-GremlinCharacter.tests.ps1 to assert detection, message text, and severity for U+2011, U+2012, and U+2014.
  • Documentation

    • Updated docs/en-US/Measure-GremlinCharacter.md severity section to explicitly list the added dash-like typographic characters under Warning.
[char]0x2011 = @{ Description = 'non-breaking hyphen'; Severity = 'Warning' }
[char]0x2012 = @{ Description = 'figure dash'; Severity = 'Warning' }
[char]0x2014 = @{ Description = 'em dash'; Severity = 'Warning' }

Copilot AI changed the title [WIP] Update Measure-GremlinCharacter rule to detect additional Unicode gremlins Measure-GremlinCharacter: detect U+2011/U+2012/U+2014 dash gremlins Aug 26, 2026
Copilot AI requested a review from HeyItsGilbert August 26, 2026 19:31
@HeyItsGilbert
HeyItsGilbert marked this pull request as ready for review August 26, 2026 19:33
Copilot AI lite review requested due to automatic review settings August 26, 2026 19:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The rule, tests, and documentation changes are consistent with existing behavior and correctly extend detection and coverage for the added Unicode dash characters.

Pull request overview

This pull request extends the Measure-GremlinCharacter PSScriptAnalyzer custom rule to detect three additional dash-like Unicode “gremlin” characters (U+2011 non-breaking hyphen, U+2012 figure dash, U+2014 em dash), aligning their severity with existing punctuation-like gremlins and keeping the diagnostic message format consistent across detections.

Changes:

  • Added U+2011/U+2012/U+2014 to the ordered gremlin map with Warning severity in Measure-GremlinCharacter.
  • Expanded the table-driven Pester cases to assert detection/message/severity for the new characters.
  • Updated the rule documentation to list the added dash-like characters under the Warning severity category.
File summaries
File Description
GoodEnoughRules/Public/Measure-GremlinCharacter.ps1 Adds the three new dash code points to the gremlin lookup map with Warning severity.
tests/Measure-GremlinCharacter.tests.ps1 Extends the parameterized test matrix to cover U+2011/U+2012/U+2014 end-to-end.
docs/en-US/Measure-GremlinCharacter.md Updates the severity description text to include the newly-detected dash variants.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

Test Results

  4 files   56 suites   8s ⏱️
 70 tests  68 ✅ 2 💤 0 ❌
284 runs  276 ✅ 8 💤 0 ❌

Results for commit 3e127d1.

♻️ This comment has been updated with latest results.

Co-authored-by: HeyItsGilbert <615265+HeyItsGilbert@users.noreply.github.com>
@HeyItsGilbert
HeyItsGilbert force-pushed the copilot/update-measure-gremlincharacter-rule branch from b8581e4 to 3e127d1 Compare August 26, 2026 19:38
@HeyItsGilbert
HeyItsGilbert enabled auto-merge (squash) August 26, 2026 19:39
@HeyItsGilbert
HeyItsGilbert disabled auto-merge August 26, 2026 19:46
@HeyItsGilbert
HeyItsGilbert merged commit dfcfb99 into main Aug 26, 2026
7 of 8 checks passed
@HeyItsGilbert
HeyItsGilbert deleted the copilot/update-measure-gremlincharacter-rule branch August 26, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants