Skip to content

Commit

Permalink
Add Pre commit hook for linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuushhh committed Nov 17, 2023
1 parent a2f1765 commit fe01afc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
default_stages: [commit]
fail_fast: true
exclude: "^(sql/|(.*\/)?migrations\/)"
default_language_version: # noqa
python: python3

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-ast
- id: check-merge-conflict
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--trailing-comma", "--line-length=125"] # Fixed the syntax error here

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies: [flake8-isort, flake8-tidy-imports]

- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
rev: v1.0.5
hooks:
- id: python-bandit-vulnerability-check
args: ["-lll", "--recursive", "-c", "bandit.yaml", "."] # Fixed the syntax error here
files: '\.py$' # Fixed the regex syntax here

- repo: local
hooks:
- id: flake8
name: flake8
entry: flake8
language: system
1 change: 1 addition & 0 deletions bandit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exclude_dirs: ['./venv', './.venv'] # noqa

0 comments on commit fe01afc

Please sign in to comment.