Skip to content

Commit

Permalink
Only run tests if python files changed (#729)
Browse files Browse the repository at this point in the history
* Do not run pre-commit hook tests if untested files change
  • Loading branch information
guarin authored Mar 10, 2022
1 parent 2c15ac8 commit 02402a8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,18 @@ repos:
entry: make test
language: system
pass_filenames: false
always_run: true
stages: [push]
# Avoid running tests if non-tested files have changed.
# The regex follows the pattern in the docs: https://pre-commit.com/#regular-expressions
exclude: |
(?x)^(
benchmark_logs/.*|
docs/.*|
examples/.*|
\.gitignore|
CONTRIBUTING\.md|
DOCS\.md|
LICENSE\.txt|
PRECOMMITHOOKS\.md|
README\.md
)$

0 comments on commit 02402a8

Please sign in to comment.