Repository navigation
chore(ci): Stage 1 developer-experience tooling (gitattributes, pre-commit, commitlint, unused-deps) - #650
Merged
Conversation
Resolves four Stage 1 "Repository, Tooling and Developer Experience" issues in one change. .gitattributes (closes 0xLizTech#85): normalize all tracked text to LF (*.sh, *.rs, *.ts, *.md and the other text formats in the tree) and mark Cargo.lock and package-lock.json as generated. The tree was re-normalized once; git ls-files --eol now shows no CRLF in the index. A new line-endings workflow fails any PR that reintroduces CRLF. Commitlint (closes 0xLizTech#90): commitlint.config.cjs enforces the Conventional Commits style documented in CONTRIBUTING.md, and a Commitlint workflow lints every commit in a PR. Allowed scopes are documented and now include the vault and common crates. Pre-commit hooks (closes 0xLizTech#89): .pre-commit-config.yaml runs LF normalization, cargo fmt --check, SDK ESLint and commitlint locally, installed via make hooks. Unused dependencies (closes 0xLizTech#92): an Unused Dependencies workflow runs cargo-machete on PRs and weekly, plus a make udeps target. The checker reports no unused dependencies in the current workspace. Supporting changes: a working flat ESLint setup for the SDK wired into npm run lint, the SDK CI job and the pre-commit hook; removal of one unused rpc type import that the new lint surfaced; and unit tests for the ESLint and commitlint configurations covering both accepted input and the key rejection modes. CHANGELOG.md and CONTRIBUTING.md updated.
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.
Summary
This pull request delivers the Stage 1 "Repository, Tooling and Developer Experience" tooling in a single change, resolving four open issues. Each adds a quality gate that was documented or expected but not enforced, so formatting, commit-style, line-ending and dependency problems are caught locally and in CI rather than reaching reviewers.
All new workflows use SHA-pinned actions, matching the existing
security.ymlandsdk-ci.ymlstyle, and the SDK test suite (365 tests), ESLint and typecheck all pass.closes #92
closes #90
closes #89
closes #85
What changed
Line endings (#85)
.gitattributesforcing LF for*.sh,*.rs,*.ts,*.md(and the other text formats in the tree:*.toml,*.json,*.yml,*.yaml,*.cjs,*.mjs), with a sensible* text=auto eol=lfdefault and binary assets excluded.Cargo.lockand**/package-lock.jsonaslinguist-generatedso GitHub collapses them in diffs.git add --renormalize .).git ls-files --eolnow shows no CRLF (i/crlfori/mixed) in the index.Line Endingsworkflow that fails any pull request reintroducing CRLF into the index.Commitlint (#90)
commitlint.config.cjsextending@commitlint/config-conventional, pinning thetype-enumto exactly the types documented inCONTRIBUTING.md(feat,fix,docs,test,refactor,chore,perf) and ascope-enumof the documented scopes plus thevaultandcommoncrates that have since been added to the workspace, anddeps/releasefor automation. Merge commits are ignored.Commitlintworkflow that lints every commit in a pull request range. A non-conforming commit fails the check.CONTRIBUTING.md.Pre-commit hooks (#89)
.pre-commit-config.yamlwith:.gitattributes).cargo fmt --checkon staged Rust..tsfile changes.commit-msgstage).make hookstarget that installs the pre-commit and commit-msg hooks, and documented the install steps inCONTRIBUTING.md.Unused dependencies (#92)
Unused Dependenciesworkflow runningcargo-macheteon pull requests, on a weekly schedule, and on demand, installed pinned and--lockedto mirror howsecurity.ymlinstallscargo-audit.make udepstarget and documented it.cargo-macheteacross the workspace: it reports no unused dependencies, so none were removed.Supporting changes
sdk/eslint.config.mjs,typescript-eslint), encoding the "noany" and unused-code parts of theCONTRIBUTING.mdTypeScript policy. The SDK'slintscript (previously referencing an uninstalled ESLint) now runs, and aLintstep was added to the SDK CI job.rpctype import insdk/src/vault.tsthat the new lint surfaced (it was referenced only in doc comments). No runtime or public API change.sdk/tests/eslint-config.test.tsasserts the config passes clean strictly-typed code and flagsanyand unused variables (allowing the_convention).sdk/tests/commitlint.config.test.tsloads the realcommitlint.config.cjsand asserts it accepts conforming commits (including thevault/commonscopes and scope-less commits) and rejects unknown types, unknown scopes, over-length subjects and non-conventional subjects.CHANGELOG.mdunder Unreleased.Testing
cd sdk && npm run lint- passes.cd sdk && npm run typecheck- passes.cd sdk && npm test- 365 tests pass, including the two new config test files.cargo machete- reports no unused dependencies.git ls-files --eol | grep -Ei '^i/(crlf|mixed)'- no matches.Notes
@commitlint/cliand@commitlint/config-conventionalat pinned versions withnpm install --no-save(the repository root has nopackage.json); this was verified to resolve theextendsand lint correctly.cargo-machetefound nothing to remove in the current workspace, so this pull request adds the gate without any dependency deletions. The gate will fail future pull requests that add an unused dependency.