summaryrefslogtreecommitdiffstats
path: root/.pre-commit-config.yaml
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-07-31 18:19:12 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-07-31 18:52:56 +0200
commit1d77aa3032e8575712821149d82e594920f05cee (patch)
tree96686112e5703469e5cb92e76548182080fee36e /.pre-commit-config.yaml
parent0cf2ee06970022f14b3a76b7c354191840c67415 (diff)
tools: Refactor python clang-format wrapping
This merges the clang-format and line-length hooks into a single one. Semantically, this makes way more sense. Also, this prevent multiple attempted commit that are rejected by pre-commit (pre-commit might skip the line-length hook if old clang-format hook already failed). Also, this removes any dependency on git-clang-format and implements the whole mechanism itself. It retrieves all added lines from the unified diff instead and is now capable of taking PRE_COMMIT_FROM_REF into account. By moving the git-related code into a separate githelper library, it's way easier to write additional python wrappers for new hooks, e.g. for clang-tidy.
Diffstat (limited to '.pre-commit-config.yaml')
-rw-r--r--.pre-commit-config.yaml13
1 files changed, 1 insertions, 12 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 2d17748bee..ee7c622631 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -78,7 +78,7 @@ repos:
hooks:
- id: clang-format
name: clang-format
- entry: tools/clang_format_wrapper.py
+ entry: tools/clang_format.py
require_serial: true
stages:
- commit
@@ -114,14 +114,3 @@ repos:
stages:
- commit
- manual
-- repo: local
- hooks:
- - id: line-length
- name: line-length
- description: Check for lines longer 100 and brakes them before 80.
- entry: ./tools/line_length.py
- stages:
- - commit
- - manual
- language: python
- files: \.(c|cpp|h)$