Skip to content

Commit

Permalink
add pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedNasser8 committed Jun 4, 2024
1 parent 8cd2b79 commit 820095c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ numpy
scipy
matplotlib
logging
pre-commit

0 comments on commit 820095c

Please sign in to comment.