diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 68000c9..4e8e44f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -23,7 +23,7 @@ jobs: - name: Run isort (auto-fix) run: isort . - - name: Run flake8 (auto-fix) + - name: Run flake8 (lint only) run: flake8 . - name: Commit and push changes if needed diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..c702b18 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +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 + + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.12.0 + hooks: + - id: isort + + - repo: https://github.com/pre-commit/mirrors-autopep8 + rev: v1.6.0 + hooks: + - id: autopep8 + + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 diff --git a/requirements.txt b/requirements.txt index bacf74b..0099e32 100755 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ numpy scipy matplotlib logging +pre-commit \ No newline at end of file