Skip to content

Commit

Permalink
Add pre-commit hooks for clang-format
Browse files Browse the repository at this point in the history
Include a clang-format pre-commit hook to ensure the code is formatted
automatically.
  • Loading branch information
apmasell committed Apr 27, 2022
1 parent 409cd6d commit 27ad72c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.1
hooks:
- id: clang-format
13 changes: 13 additions & 0 deletions docs/source/contributing.rst
Expand Up @@ -78,6 +78,19 @@ Coding conventions
for maximum readability with all existing tools, such as code
review user interfaces.

Optionally, you may wish to setup `pre-commit hooks <https://pre-commit.com/>`_
to automatically run ``clang-format`` when you make a git commit. This can be
done by installing ``pre-commit``::

pip install pre-commit

and then running::

pre-commit install

from the root of the Numba repository. Now ``clang-format`` will be run each time
you commit changes. You can skip this check with ``git commit --no-verify``.


Platform support
----------------
Expand Down

0 comments on commit 27ad72c

Please sign in to comment.