Skip to content
Snippets Groups Projects
Commit d16cb01d authored by Erwan Rouchet's avatar Erwan Rouchet Committed by Bastien Abadie
Browse files

Add a pre-commit hook for long test files

parent 5688c656
No related branches found
No related tags found
1 merge request!2442Add a pre-commit hook for long test files
......@@ -34,3 +34,13 @@ repos:
- repo: meta
hooks:
- id: check-useless-excludes
- repo: local
hooks:
- id: long-test-files
name: Warn about long unit test files
language: script
entry: ci/long-test-files.sh
# Only run on Arkindex unit test files
files: '^arkindex\/[^\/]*\/tests\/(.*\/)?test_.*\.py'
# Always show output, even when the hook passes, since the hook only warns and doesn't fail
verbose: true
#!/bin/sh
wc -l "$@" | awk '$2 != "total" && $1 > 1000 { OFS=""; print $2, " is too long (", $1, " lines)" }'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment