-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
25 lines (22 loc) · 863 Bytes
/
.pre-commit-config.yaml
File metadata and controls
25 lines (22 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
repos:
- repo: local
hooks:
- id: autopep8
name: autopep8 (autoformat)
entry: bash -c "autopep8 --in-place --aggressive --recursive src/ tests/ && git add -u"
language: system
types: [python]
stages: [pre-commit]
- id: pylint
name: pylint (changed files)
entry: bash -c 'export PYTHONPATH=${PYTHONPATH}:./src; files=$(git diff --name-only --cached --diff-filter=ACMR | grep "^src/.*\.py$"); [ -n "$files" ] && echo "$files" | xargs pylint || echo "No Python files to lint in src/"'
language: system
types: [python]
stages: [pre-commit]
pass_filenames: false
- id: pytest
name: Run tests
entry: bash -c "pytest --cov=src && rm -f .coverage"
language: system
types: [python]
pass_filenames: false