Repository navigation
ci: ratchet one-function-per-file from max_lines = 100 to 24 - #1035
Merged
Merged
Conversation
24 is the lowest uniform threshold green across every opted-in scan root today; internals/checks binds it, where preflight/gate.py's `run` is 24 lines. At 23 that file fails, so this is the floor, not a round number. Re-verified at 24 on this base with testing-conventions@0.0.111: all five roots exit 0, and a 23 probe fails as expected.
This was referenced Sep 4, 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.
Fixes #1033. Step under #1020, which ratchets
one-function-per-filefrommax_lines = 100toward the default of 1, one PR per step.What changed
Six lines of TOML across five configs,
100->24:testing-conventions.toml(two occurrences:[python]and[typescript])packages/python/testing-conventions.tomlpackages/ts/testing-conventions.tomlinternals/checks/testing-conventions.tomlplugins/dirsql-plugin-embeddings/testing-conventions.tomlNo source file moves. Nothing about the tree changes.
Why 24 and not 40
#1033 originally proposed 40. 24 is the lowest uniform value green across the whole repo today, and it costs exactly what 40 costs: zero file splits. Stopping at 40 would spend a ratchet step on a threshold no file is near, then need a second PR to land here.
internals/checksis the binding constraint:checks/preflight/gate.py:167runruns 24 lines, sharing a file withinvocation. At 23 the gate fires on it. So 24 is a measured floor, not a round number.Re-verified at 24 on this base
The enumeration in #1033 predates later merges and the margin is one line wide, so it was re-run against this PR's base (
249ac46). Version pinned totesting-conventions@0.0.111(the currentlatest) rather than a barenpx testing-conventions, which resolves engine-aware and can silently pick an older release (#1018, and #1020's closing note):packages/python/dirsqlpackages/python/testing-conventions.tomlpackages/ts/srcpackages/ts/testing-conventions.tomlinternals/checks/srcinternals/checks/testing-conventions.tomlinternals/distcheck/srctesting-conventions.toml(root default)plugins/dirsql-plugin-embeddings/srcplugins/dirsql-plugin-embeddings/testing-conventions.tomlAll five exit 0. Negative control, same harness,
internals/checksat 23:Exit 1. The zero above is a real pass, not a misread config.
just preflightalso run over the full matrix (not just this gate, since a threshold change can surface interactions): 0 failing pairs, 3 skipped (packaging, which needs a built artifact).Rust stays out of scope
Not opted in, and this PR does not change that. Upstream defaults the rule off for Rust because a Rust file is a module. Opting it in is a separate design call (#1020 says the same).
Changelog
The
changelog-checkworkflow does trigger on this diff -- three of the five configs sit underpackages/**/plugins/**, which its path filter matches. The gate then passes with no fragment:changelog_gate/decide.py's_is_exemptexplicitly waives<pkg>/testing-conventions.tomlas gate config that ships in no published artifact. Verified locally against this base, exit 0. Noskip-changelogline was used -- the exemption carries it, and CI proves it on this PR.E2E Verification
N/A - docs/lint/typo only
Changelog / Migrations
<root>/<pkg>/changelog.d/for each changed package -- not required: no package source changed;testing-conventions.tomlis exempt in the gate<root>/<pkg>/migrations.d/-- not required: no public API or runtime behavior changeCI note
The first
CI Gaterun failed on a prediction gap, not a check: willfire's expected set omittedchangelog-check.yml, which then reported, so the gate flagged an unpredicted run. Every other check was green at that moment. Re-running willfire locally at the same version (0.1.47) against this PR predictschangelog-check.ymlasrun-- the CI prediction had been computed against a test-merge commit GitHub had not finished materializing (the same log showsno workflow file at the test merge commitfor workflows that plainly exist).gh run rerun --failedpassed with no code change.