clang-format-hooks icon indicating copy to clipboard operation
clang-format-hooks copied to clipboard

Apply a coding style with clang-format only to new code added to an existing code base.

Results 12 clang-format-hooks issues
Sort by recently updated
recently updated
newest added

Thanks for these git hooks. Is there support for using the scripts in this repo with the [pre-commit framework](https://pre-commit.com/)? The pre-commit framework is useful for incorporating multiple hooks that are...

OS: macOS 11.5.2 clang-format version 12.0.1, installed by Homebrew But, error while using it: ``` $ ./scripts/apply-format -i --staged Cannot find clang-format-diff which should be shipped as part of the...

I get the following error when making a commit, using clang-format-diff from clang 9. Traceback (most recent call last): File "/usr/local/bin/clang-format-diff", line 127, in main() File "/usr/local/bin/clang-format-diff", line 110, in...

README.md instructs people that: > Add the `apply_format` and `git-pre-commit-format` scripts to your repositories. > You can either copy them (maybe in a `scripts/` sub-directory) or add this whole repository...

Most our code is not formatted. We want to "get there" by steps, so we use this hook to format modified code and even then it is not always used....

The existing heuristic for handling worktrees assumes that one other worktree contains a ".git" subdirectory with the Git database. This heuristic fails when worktrees are attached to a bare repository.

It would be cool to get this property supported. https://git-scm.com/docs/git-config#git-config-corehooksPath

Issue: When removing the first line from a file, the pre-commit hook fails with the following error, preventing commit. ``` [test-clang-format-repo]$ git commit -m "Test file remove first line" error:...