Repository navigation
Conversation
Add .gitattributes to force LF, pre-commit hooks for cargo fmt and eslint, a commitlint config with a CI job, and a pinned cargo-machete job for unused dependencies. Document each in CONTRIBUTING.md and cover them with tests under sdk/tests/tooling. Closes 0xLizTech#85, closes 0xLizTech#89, closes 0xLizTech#90, closes 0xLizTech#92
OrderStream
reviewed
Oct 22, 2026
OrderStream
left a comment
There was a problem hiding this comment.
Solid DX and tooling enhancement across the repository:
- Line normalization: Excellent inclusion of .gitattributes enforcing LF across shell, Rust, and TS files to eliminate cross-platform CRLF churn on Windows/Linux environments.
- CI robustness: Pinning cargo-machete (v0.7.0) and action hashes prevents unexpected upstream breakages during scheduled dependency audits.
- Modern ESLint: Updating sdk/eslint.config.mjs to flat config cleanly removes deprecated --ext CLI flags while preserving type linting.
- Recommendation: For commitlint, ensure branch protection also validates PR titles if merge strategy is squash-and-merge.
Clean implementation and comprehensive test coverage.
This branch has not been deployed
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
#92 Unused dependency check
scripts/check-unused-deps.sh, a wrapper around cargo-machete, plus--self-test, which proves the check passes on a clean crate and fails on a crate with an unused dependency.Unused Dependenciesworkflow. It runs weekly (Mondays 07:00 UTC), on manual dispatch, and on pushes and pull requests that touch Rust code or manifests. cargo-machete is pinned to 0.7.0 and the actions are pinned.make unused-depsandmake unused-deps-selftest, and documented both in CONTRIBUTING.md.#90 Commitlint
commitlint.config.cjswith the seven types documented in CONTRIBUTING.md and a scope list. Subjects are limited to 72 characters, and an empty subject or trailing full stop is rejected.Commitlintworkflow, which lints every commit in a pull request (base..head). It skips Dependabot.!breaking-change marker andmake commitlintin CONTRIBUTING.md.#89 Pre-commit hooks
.pre-commit-config.yamlwith two hooks:cargo fmt --all -- --checkwhen a.rsfile is staged, and eslint on stagedsdk/src/*.tsfiles throughscripts/pre-commit-eslint.sh.make hooksand documented the install steps in CONTRIBUTING.md.sdk/eslint.config.mjsand the eslint devDependencies. The SDKlintscript existed but eslint was never installed or configured, and--extwas dropped from the script because it does not apply to flat config. SDK CI now runsnpm run lint.#85 Line endings
.gitattributesforcing LF for*.sh,*.rs,*.tsand*.md, plus*.cjs,*.mjs,*.js,*.json,*.toml,*.yml,*.yamlandMakefile.text=autois the fallback, and binary files are left alone.Cargo.lockand both npm lockfileslinguist-generated.git ls-files --eolalready shows noi/crlfori/mixed.git add --renormalize .is documented for older forks.Tests
Added under
sdk/tests/tooling/, in the existing vitest suite:.gitattributesshows the same input stays CRLF.No existing test fixture was changed.
Notes
Lintstep.sdk/package.jsongains devDependencieseslint,@eslint/js,typescript-eslintand@commitlint/cli, and the lockfile is updated. None ship in the published package.common,benchmarkandreadmeto the eight documented ones. History uses them, and CONTRIBUTING.md's owndocs(readme)example needsreadme. Scopes remain optional.sdk/srconly, matchingnpm run lint. TypeScript formatting is not enforced, as there is no prettier in the repo, so "bad formatting is rejected" applies to Rust throughcargo fmt.Lintstep could surface existing eslint findings the first time it runs. Theno-unused-varsrule ignores names starting with_.[package.metadata.cargo-machete] ignored.closes #92
closes #90
closes #89
closes #85