Skip to content

Commit

Permalink
Add pre-commit configuration
Browse files Browse the repository at this point in the history
Install pre-commit with:

    pip install pre-commit
    pre-commit install

It will run tests before any commit to detect errors early.
  • Loading branch information
schodet committed Jan 3, 2024
1 parent fad340a commit 6699afb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
# Exclude files not cleaned up yet.
exclude: |
(?x)^(
nxt/sensor/digital\.py|
nxt/sensor/hitechnic\.py|
nxt/sensor/mindsensors\.py|
)$
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
# Exclude files not cleaned up yet.
exclude: |
(?x)^(
nxt/sensor/digital\.py|
nxt/sensor/hitechnic\.py|
nxt/sensor/mindsensors\.py|
)$
- repo: local
hooks:
- id: pytest
name: pytest
language: system
entry: python3 -m pytest
types: [python]
pass_filenames: false
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
stages: [push, manual]
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ include contrib/60-libnxt.rules
include docs/Makefile
include docs/conf.py
include docs/favicon.ico
include .pre-commit-config.yaml
recursive-include docs *.rst
recursive-include examples *.py

0 comments on commit 6699afb

Please sign in to comment.