notebook-uniformity hook: drive it from the convention points - #1688
Open
classiqdor wants to merge 1 commit into
Open
notebook-uniformity hook: drive it from the convention points#1688classiqdor wants to merge 1 commit into
classiqdor wants to merge 1 commit into
Conversation
The hook re-implemented the same regexes that live in .internal/conventions/ points/. Now it imports the points (via a new 'points' symlink to ../conventions/points — no sys.path juggling) and applies the fix() of every point marked 'enforced', then reports any enforced point that still fails (e.g. opens_h1, which has no auto-fix). One source of truth per convention: adding/changing an enforced rule is now a one-file edit under points/. Hook drops from ~200 to ~80 lines; behaviour and the enforced set (show, result_value, references, single_h1, opens_h1) unchanged.
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.
Follow-up to the conventions kit (#1673) and the pre-commit-tools refactor (#1686).
What
The
notebook-uniformitypre-commit hook used to re-implement the same regexes that already live in.internal/conventions/points/. It now imports the points and applies theirfix()instead — one source of truth per convention.enforced, applies itsfix(), then reports any enforced point that still fails (e.g.opens_h1, which has no auto-fix and can only be reported).pointssymlink →../conventions/points(mode120000), so the import is a plainfrom points._model import …with nosys.pathjuggling — same spirit asmetadata_validateimporting its siblings.points/; the hook needs no changes.Unchanged
show,result_value,references,single_h1,opens_h1.git add, report the unfixable ones.Verification
qprog.show(), singular## Reference) → auto-fixed toshow(qprog)/## References, reported, exit 1; re-run → clean.validate symlinkshook passes on the new symlink.Note
Depends on the points living on
main(merged via #1673) — safe to merge now.