Open Waqar144 opened 2 years ago
So someone needs to run the clang-format for the whole project first?
Once such a check and action is in place, then yes, it would make sense to format everything once and then maintain it.
Files .git are not in the version control system, aren't they?
I created the files to do a git clang-format --diff
, but that only says: git: 'clang-format' is not a git command. See 'git --help'.
Files .git are not in the version control system, aren't they?
They aren't, but somehow they are in KDE repos. Maybe their manually inserted by a script or something?
Do you have clang-format installed? also check if you have which git-clang-format
They aren't, but somehow they are in KDE repos. Maybe their manually inserted by a script or something?
maybe you need a git command to create the hook
Do you have clang-format installed? also check if you have which git-clang-format
no, and I can't find a package for it, I only have clang-format installed
Weird. I thought it was automatically installed when you install clang-format
. It's basically a wrapper script over clang-format
https://github.com/llvm/llvm-project/blob/main/clang/tools/clang-format/git-clang-format
Code formatting is getting messier and inconsistent with the passage of time. It would be a good idea to enforce it via some action. Maybe this one? https://github.com/jidicula/clang-format-action
Also, not sure if this is possible, but having a pre-commit hook that is available whenever you clone the repo for formatting would be nice as well. The hook runs whenever you are going to commit and warns you if the formatting is bad. Following is the precommit hook being used in KDE repos:
.git/hooks/pre-commit
.git/hooks/scripts/clang-format.sh