Skip to content

Add BOM sniff#890

Merged
GaryJones merged 3 commits into
developfrom
add/BOM-sniff
Jul 7, 2026
Merged

Add BOM sniff#890
GaryJones merged 3 commits into
developfrom
add/BOM-sniff

Conversation

@mchanDev

@mchanDev mchanDev commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

UTF8 with BOM has broken a few things, attempt to add a sniff to catch it

…et to prevent changing the superfluous space check
@mchanDev mchanDev requested a review from a team as a code owner July 7, 2026 11:33
GaryJones added 2 commits July 7, 2026 14:38
The BOM sniff test relies on `ruleset-test-bom.inc` beginning with a
UTF-8 byte order mark. The global `[*]` section sets `charset = utf-8`,
which prompts EditorConfig-aware editors to strip that mark on save,
silently invalidating the Generic.Files.ByteOrderMark ruleset test. A
scoped `[*-bom.inc]` override with `charset = utf-8-bom` instructs those
editors to keep the mark, protecting the fixture from accidental damage.
Guarding the success path with `$test->passes() && $bom_test->passes()`
short-circuits: when the primary ruleset test fails, the BOM test's
`passes()` never runs, so its discrepancy report is never printed. That
hides half the picture from anyone debugging a failure. Evaluating both
results into variables before the check lets each test report its own
discrepancies independently.
@GaryJones GaryJones merged commit c4531d7 into develop Jul 7, 2026
26 checks passed
@GaryJones GaryJones deleted the add/BOM-sniff branch July 7, 2026 14:08
@GaryJones

Copy link
Copy Markdown
Contributor

Thank you!

@GaryJones GaryJones added this to the 3.x milestone Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants