CLOS-4334: Remove BOM file markers and introduce non-ASCII check action#53
Merged
azheregelya merged 5 commits intocloudlinux:cloudlinuxfrom Apr 27, 2026
Merged
CLOS-4334: Remove BOM file markers and introduce non-ASCII check action#53azheregelya merged 5 commits intocloudlinux:cloudlinuxfrom
azheregelya merged 5 commits intocloudlinux:cloudlinuxfrom
Conversation
Likely caused by editor settings that were not noticed at the time.
After the fix in b24a939, introducing additional check to ensure the same problem doesn't happen again.
…putils.py The earlier BOM cleanup (commit 81fb25d "Remove BOM file markers from files that had them introduced previously") missed this one file. The new lint-cloudlinux GitHub Action surfaced it on a dry run.
The non-ASCII gate added in commit 92aee84 lived inline in the lint target and used a plain grep that did not honor PEP 263 encoding declarations. Two tradeoffs followed: - CI cannot easily reuse just that step without running the full lint pipeline (pylint + flake8), and the full pipeline is currently noisy on the cloudlinux tree. - Test fixtures that legitimately contain non-ASCII (e.g. rootscanner/tests/test_rootscanner.py with Cyrillic strings declared via '# -*- coding: utf-8 -*-') trip the grep even though Python accepts them. Move the check to utils/check-non-ascii.py, a small stdlib-only python3 script that walks the supplied paths, skips files with a PEP 263 declaration on line 1 or 2, and reports lineno + line text for every remaining offender. Wire the script into the Makefile as a new lint-non-ascii target and make it a prerequisite of lint, so the existing developer-facing behavior is unchanged: `make lint` still does the non-ASCII check plus pylint plus flake8, just via a script instead of an inline grep. A standalone target also lets CI invoke just this gate without paying for the full lint venv setup.
The cloudlinux fork uses the cloudlinux branch as trunk; the inherited upstream workflows (unit-tests.yml, codespell.yml, etc.) only fire on master so they never run for PRs into this fork. Add a narrow workflow that runs on every push and PR targeting cloudlinux and invokes `make lint-non-ascii` to gate against stray non-ASCII bytes in Python source. Calling the make target keeps a single source of truth: local `make lint` runs the same check via the same script, so what passes locally is exactly what passes in CI. Resurrecting the full upstream test+lint matrix on this fork is a separate, larger task.
Collaborator
Author
|
Originally this was just about BOM markers rediscovered by accident, but that alone did not answer the question "how do we prevent this from happening again?". |
azheregelya
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Likely caused by editor settings that were not noticed at the time.
Also adds the corresponding check to the lint command in Makefile.