Skip to content

Commit

Permalink
Add pre-commit config
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau committed Oct 31, 2024
1 parent 335e102 commit 5ee3ced
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: local
hooks:
- id: tests
name: tests
entry: bash -c ". .venv/bin/activate && scripts/tests"
language: system
files: \.py$
pass_filenames: false

- repo: local
hooks:
- id: lint
name: lint
entry: bash -c ". .venv/bin/activate && scripts/lint"
language: system
files: \.py$
pass_filenames: false

# Check GitHub workflows
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.1
hooks:
- id: check-github-workflows
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,3 @@ Other people contributed to Yokadi:
- Jonas Christian Drewsen <[email protected]>: quarterly recurrence feature

<!-- vim: set ts=4 sw=4 et: -->

1 change: 0 additions & 1 deletion doc/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@ shortcuts such as:
- ctrl-w delete last word

<!-- vim: set ts=4 sw=4 et: -->

1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage==7.6.0
flake8==7.1.0
pytest==8.3.2
pytest-xdist==3.6.1
6 changes: 6 additions & 0 deletions scripts/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail

cd $(dirname $0)/..

pytest -n auto yokadi/tests/tests.py

0 comments on commit 5ee3ced

Please sign in to comment.