This *mostly* resembles our current coding style, at least to the extent
possible with clang-format.
There are a few oddities but they're not worth fighting over (for now)
and the most egregious violations have been addressed by shuffling
things around or just disabling clang-format in the previous commits.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1246>
It's a bit annoying to only find those during a CI pipeline run, so
let's add a hook for it. Pre-commit doesn't seem to have something
useful for duplicate line detection so let's hack up a quick script
that can do this for us, together with the other whitespace checks in
the CI so we're consistent.
Excluded from the duplicate line checks are anything "Not C" and the
"include/" directory since we don't control those files.
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1154>
This ensures a few things are correct before we commit and/or push,
making life a bit easier for both our contributors and our maintainers
since some things should no longer end up in the MRs.
Activate via:
$ pre-commit install
$ pre-commit install --hook-type pre-push
The latter is required for the ci-templates hooks which are pre-push
only.