Run cmake-lint as part of lintstaged
Details
- Reviewers
atul
Install cmake-lint, or use nix develop
# open a CMakeLists.txt, and add a line more than 80 characters to the top of # the file git checkout -b tmp git add <file> git commit -m "test" # should fail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- jonringer/cmake-lintstaged (branched from master)
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Not sure, but I think we should add a section on the docs to tell the user how to install cmake-lint, because otherwise they won't be able to commit code that's matched by the cmake-lint glob in .lintstagedrc.js. Do we need pip to install cmake-lint?
Something like D4771 (you can probably just copy the format in there) should be amended to this stack (probably before this diff), because this addition to lint-staged depends on the user having cmake-lint already installed. Also we'll have to send a message for everyone to install cmake-lint anyways, like @atul said in D4772.
Also, you can probably rename the [chore] part in this diff to something like [lint-staged] or [lintstaged] just going off prior examples like D4620 and D4772. Or you could make it [cmake-lint]. For me, [chore] is usually reserved for a nit or trivial change, not something like installing/adding a new dependency.
Other than that, this looks good! But requesting changes for your/other reviewers' thoughts on the above feedback.
Do we need pip to install cmake-lint?
Problem with asking people to do pip install cmakelang is that the package requirements will likely fail to be compatible with any other system installed package. Homebrew and nix get around this by creating per-package venv's but that's not available with raw pip invocations.
If we're fully deprecating non-Nix workflow we can probably add cmake-lint to Nix and bring back this diff?