Skip to content

style: Strip stray control characters instead of excluding files - #7891

Merged
echoix merged 1 commit into
OSGeo:mainfrom
echoix:editorconfig-strip-control-bytes
Sep 5, 2026
Merged

style: Strip stray control characters instead of excluding files#7891
echoix merged 1 commit into
OSGeo:mainfrom
echoix:editorconfig-strip-control-bytes

Conversation

@echoix

@echoix echoix commented Sep 5, 2026

Copy link
Copy Markdown
Member

Follow-up to #7459, resolving the discussion in #7888.

The editorconfig-checker bump to v3.11.3 added a pre-decode binary-detection
check that flags a file as binary, and so fails the utf-8 charset check, if it
contains any C0 control byte. Four files were marked charset = unset as a
mechanical workaround. In #7888, @nilason confirmed the bytes in three of them
carry no meaning and are better removed, including the vendored ccmath file,
which is no longer maintained upstream.

Changes

  • raster/r.drain/README, scripts/r.drain/README: drop a stray 0x18 (CAN)
    in line 24, that <CAN>differ a little from r.drain.
  • lib/external/ccmath/C01-matrix: lines 880-881 held a 0x13/0x16
    (DC3/SYN) pair acting as a subscript toggle around U1. The same matrix is
    written plainly as U1 everywhere else in that file, including at lines
    682-694, 788, 803, 811 and 868, and in the very signature these two lines
    document (u1 = pointer to store of m by n transformation matrix U1), so
    the reading is confirmed rather than inferred.
  • .editorconfig: the exception now covers only configure, whose BEL byte is
    a legitimate awk field separator in autoconf-generated code.

No behavioral change; documentation and build-config text only.

Verification

pre-commit run editorconfig-checker --all-files reports zero charset, utf-8
or binary errors across the tree. lib/external/ccmath/C01-matrix is now
decoded and charset-checked without complaint rather than skipped, which is
the positive confirmation that the strip worked; the two READMEs no longer
appear at all.

The only errors in that run are line-ending ones, which are a local
core.autocrlf=true checkout artifact on Windows (git ls-files --eol shows
i/lf w/crlf on untouched files too), not something this PR introduces.

Closes #7888

AI (Claude Opus 5) was used to locate the byte sequences, verify the U1
reading against the rest of the file, and check the result with the hook.

The editorconfig-checker bump to v3.11.3 (OSGeo#7459) added a pre-decode
binary-detection check that flags a file as binary, and thus failing the
utf-8 charset check, if it contains any C0 control byte. Four files were
marked charset = unset as a workaround. Per the discussion in OSGeo#7888,
three of them hold no meaning in those bytes and are better cleaned up:

- raster/r.drain/README and scripts/r.drain/README contain a stray CAN
  (0x18) inside "that differ a little from r.drain".
- lib/external/ccmath/C01-matrix contains a DC3/SYN pair acting as a
  subscript toggle around "U1"; the same matrix is spelled U1 plainly
  everywhere else in that file.

Only configure still needs the exception: its BEL byte is a legitimate
awk field separator in autoconf-generated code.

Closes OSGeo#7888
@echoix
echoix enabled auto-merge (squash) September 5, 2026 16:52
@github-actions github-actions Bot added CI Continuous integration raster Related to raster data processing libraries module labels Sep 5, 2026
@echoix
echoix merged commit 14e4e27 into OSGeo:main Sep 5, 2026
18 of 24 checks passed
@github-actions github-actions Bot added this to the 8.6.0 milestone Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous integration libraries module raster Related to raster data processing

Projects

None yet

2 participants