Create cpp-linter-hooks for pre-commit
Closed this issue · 5 comments
Add following config to .pre-commit-config.yaml
repos:
- repo: https://github.com/shenxianpeng/cpp-linter-hooks
rev: v0.1.0
hooks:
- id: clang-format
args: [--style=.clang-format]
- id: clang-tidy
args: [--checks=.clang-tidy]Done in v0.1.0
Hi @2bndy5
Recently I create this hook used for pre-commit, as my test, and it's working now. I think we can move this repo to @cpp-linter because it's related to cpp linter.
Along with this repo, there is another repo [clang-tools-pip]h(ttps://github.com/shenxianpeng/clang-tools-pip) which is used to install clang-tools binaries with pip.
In the further we can use [clang-tools-pip]h(ttps://github.com/shenxianpeng/clang-tools-pip) to install clang-tools to replace uses: KyleMayes/install-llvm-action@v1, the only problem is there is an issue for clang-tidy-14 on Linux, which is not I can control because the binary is provided by https://github.com/muttleyxd/clang-tools-static-binaries. I want to build and pack clang-tools binaries by clang-tools-pip later.
Any questions/suggestions/contributions are appreciated.
pre-commit workflows often offer the ability to commit changes to satisfy a failing check. Would a feature like that be possible here?
I like what you've been doing, and its taking me some time to catch up with all your progress. I do think this repo (and the clang-tools-pip repo) belong in the cpp-linter org.
pre-commit workflows often offer the ability to commit changes to satisfy a failing check. Would a feature like that be possible here?
Yes. here is the output when pre-commit check the commit changes failed with this hook.
I want the cpp-linter org could support any CI tools/plugins regarding c/c++ code formatting, etc.
OK, I am going to move this and clang-tools-pip repos to @cpp-linter org.
Transfer ownerships are done.