Age | Commit message (Collapse) | Author |
|
and target
Previously the clang-format.sh git hook script didn't specify the file
extensions to format; however it looks like with recent(?) clang-format
versions 'git clang-format' will consider .json files if such files were
changed by a commit, which makes the script fail, see:
https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/254
Sepcify the file extensions by passing --extensions to 'git clang-format'
command.
Also add ".hpp" to the file extensions we format, and use the same list of
file extensions everywhere.
|
|
Otherwise recent versions of git will complain with:
```
hint: The '.git/hooks/pre-commit' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
```
|
|
This check fixes a probably rare case, where we land in a repository
that contains this clang-format.sh hook but where the format file went
missing. In such cases, clang-format falls back to the system defaults,
which brings undesired defaults, e.g. enforced line breaks in comments
after 90 chars, which cannot easily be reverted by a reformat.
Since clang-format's --fallback-style=none option is not available for
git clang-format, this comment reimplements the logic.
|
|
This will allow us to force QS checks before
the developer commits a change. Currently only
clang-format is supported, but as on #plasma and
https://phabricator.kde.org/T11214 discussed we
might want to add different formatters.
By making the checks configurable we are flexible
and can easily extend it.
|