chore(checks): add local quality checks and CI ratchets - #961
Merged
Merged
Conversation
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.
✅ Deploy Preview for volview-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Adds quality ratchets that run in the pre-commit hook and in CI. Each one compares the files a change touches with the base, so a change can lower the debt it touches but not add to it. Existing debt is left alone until someone edits that file.
The checks (
node scripts/checks/check.mjs, limits inscripts/checks/config.mjs)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 get worse.tests/baseline.Locally the hook compares staged content with
HEAD. In CI a new "Quality ratchets" step in the checks workflow compares with the pull request's target branch. It is skipped for merge queue runs, which have no target branch to compare with.CONTRIBUTING.mddescribes the checks and how to run them by hand.ESLint
npm run lintreports the existing debt as 87 warnings and no errors..mjstooling, andscripts/**/*.mjsjoins lint and lint-staged.@/src/alias. The processing engine's sibling imports move to the alias to match. A boundary is also declared forsrc/segmentation. Those files do not exist yet, so its rules match nothing for now.