Skip to content

Commit

Permalink
Create .pre-commit-config.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and gacarrillor committed Apr 12, 2024
1 parent 1884dd0 commit 1c1e378
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
repos:
- repo: local
hooks:
- id: banned-words
name: Check Banned Words
entry: ./scripts/banned-words.sh
language: script

# Fix end of files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: .*\.qgs
- id: end-of-file-fixer
exclude: .*\.qgs
- id: mixed-line-ending
exclude: .*\.qgs
args:
- '--fix=lf'

# Remove unused imports/variables
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- "--in-place"
- "--remove-all-unused-imports"
- "--remove-unused-variables"

# Sort imports
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
- id: isort
args: ["--profile", "black"]

# Black formatting
- repo: https://github.com/psf/black
rev: "24.3.0"
hooks:
- id: black
args: ["--line-length=99"]

# tool to automatically upgrade syntax for newer versions of the language
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py37-plus]

# Lint files
- repo: https://github.com/pycqa/flake8
rev: "7.0.0"
hooks:
- id: flake8
args: [
"--max-line-length=115",
# ignore long comments (E501), as long lines are formatted by black
"--ignore=E501,E203,W503",
]

0 comments on commit 1c1e378

Please sign in to comment.