Add pre-commit to ensure consistent formatting

This commit is contained in:
Kacper Łukawski
2025-03-05 22:47:12 +01:00
parent 7c1d05ae17
commit e673084c5e
8 changed files with 149 additions and 20 deletions

34
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,34 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.10
ci:
autofix_prs: true
autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
autoupdate_schedule: quarterly
# submodules: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-ast
- id: check-added-large-files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: "Sort Imports"
args: [ "--profile", "black" ]