Skip to content

Enable more ruff and pyrefly checks - #272

Merged
jjohnson42 merged 4 commits into
xcat2:masterfrom
Obihoernchen:ruff-more-checks
Aug 11, 2026
Merged

Enable more ruff and pyrefly checks#272
jjohnson42 merged 4 commits into
xcat2:masterfrom
Obihoernchen:ruff-more-checks

Conversation

@Obihoernchen

@Obihoernchen Obihoernchen commented Aug 11, 2026

Copy link
Copy Markdown
Member

Enable additional useful Ruff and Pyrefly checks that already pass or require only minor fixes.

Each is the only thing keeping its rule group from being selectable whole.
userutil.py imported ctypes with a star; the names it uses are POINTER,
byref, c_char_p, c_int, c_int32, c_uint and cdll. The oem lookup loop had an
else with no break, so the else always ran. The alert parameter table wrapped
int in a lambda that only forwards to it. And the watchdog interval passed 0
where os.environ.get documents a string, which worked because int(0) is 0.
@Obihoernchen Obihoernchen changed the title Ruff more checks Enable more ruff checks Aug 11, 2026
@Obihoernchen Obihoernchen changed the title Enable more ruff checks Enable more ruff and pyrefly checks Aug 11, 2026
Every rule added here is at zero once the previous commit lands, so it costs
no cleanup: the point is that a future patch cannot introduce one without the
ruff job failing. They are the rest of pyflakes' format-string checks,
flake8-2020, most of bugbear, the pylint warnings that describe bugs rather
than style, four flake8-async rules for blocking calls in coroutines, and
some RUF, LOG, PGH, PIE, ISC and EXE rules in the same spirit. Each was
confirmed to fire on a synthetic violation, so none is silently inert under
the py37 target.

Rules are named by group wherever the group is already clean, and each prefix
stops short of a rule that is not: PLW150 rather than PLW15, which would pull
in PLW1510. Bugbear is listed rule by rule apart from B02 and B03, since
B006, B007 and B018 are all left out on purpose.
Fifteen error kinds beyond the two async ones report nothing on this tree
today and have something in it to bite on, so turning them on costs no
findings and keeps it that way.

invalid-syntax is the one that closes a gap rather than covering ground
another check already holds: CI compiles under a modern interpreter, which
accepts syntax the el8 and sles15 interpreters cannot parse. Checking
against python-version rejects it instead, which makes that setting load
bearing for the first time.

Kinds whose subject matter this tree does not contain stay off, among them
everything reached only through typing: the module is never imported, so
TypeVar and namedtuple naming and stale `# type: ignore` have nothing to
find here.
@jjohnson42
jjohnson42 merged commit 8d519b5 into xcat2:master Aug 11, 2026
4 checks passed
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.

2 participants