You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6fac85b
Browse filesBrowse the repository at this point in the historyBrowse files
chore(checks): add local quality checks and CI ratchets
Adds scripts/checks: complexity, duplication and convention ratchets that the
pre-commit hook runs on staged content and that CI runs against the base of
the pull request, so a change can only lower the debt it touches. Extends
lint-staged and the lint script to the scripts directory.
The eslint config gains the segmentation feature boundary ahead of the module
landing, a node-globals block for .mjs tooling, and warn-level limits that
mirror the ratchet thresholds so editors surface them. Each pure layer is
guarded by its one list of pure files: a pure file may import from its own
feature only what is on that list, spelled from the alias, so the processing
engine's sibling imports move to the alias.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,18 @@ npm run lint
75
75
76
76
---
77
77
78
+
## Quality checks
79
+
80
+
The pre-commit hook and CI run `node scripts/checks/check.mjs`. It compares the files you changed with the base (`HEAD` locally, the target branch in CI), so existing code is left alone and only a change that makes a file worse fails.
81
+
82
+
- Complexity: in `src`, a function stays within cyclomatic complexity 10, nesting depth 3 and 4 parameters, and a file within 600 lines. A file already over a limit may not go further over, and a new file must be within all of them.
83
+
- Duplication: a change to the tests may not add a block of 60 or more tokens that repeats another test.
84
+
- Conventions: no new binary files outside the directories that already hold them, such as `tests/baseline`.
85
+
86
+
The limits are in `scripts/checks/config.mjs`. Stage your changes before running the script by hand, since it reads the index. `CHECKS_SKIP=1 git commit` skips it for one commit.
message: `Import the ${dir} feature only from its public surface \`@/src/${dir}\` (src/${dir}/index.ts). A deep import bypasses the feature boundary.`,
0 commit comments