-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Guts/tooling/add-pre-commit
Tooling: add git hooks (through pre commit microframework)
- Loading branch information
Showing
3 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# IDE | ||
.idea | ||
.pyc | ||
__pycache__ | ||
|
||
# packaging | ||
zip_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
exclude: ".venv|tests/dev/|tests/fixtures/" | ||
fail_fast: false | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: | ||
- --maxkb=500 | ||
- id: check-case-conflict | ||
- id: check-xml | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: fix-byte-order-marker | ||
- id: fix-encoding-pragma | ||
args: | ||
- --remove | ||
- id: trailing-whitespace | ||
args: | ||
- --markdown-linebreak-ext=md | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.5.0" | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix-only | ||
- --target-version=py39 | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
args: | ||
- --target-version=py39 | ||
|
||
# Disabled until PyQt translation support f-strings | ||
# - repo: https://github.com/asottile/pyupgrade | ||
# rev: v3.15.0 | ||
# hooks: | ||
# - id: pyupgrade | ||
# args: | ||
# - "--py39-plus" | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
args: | ||
- --profile | ||
- black | ||
- --filter-files | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 7.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: ["flake8-qgis"] | ||
args: | ||
[ | ||
"--config=setup.cfg", | ||
"--select=E9,F63,F7,F82,QGS101,QGS102,QGS103,QGS104,QGS106", | ||
] | ||
|
||
ci: | ||
autofix_prs: true | ||
autoupdate_schedule: quarterly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Contributing Guidelines | ||
|
||
First off, thanks for considering to contribute to this project! | ||
|
||
These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. | ||
|
||
## Git hooks | ||
|
||
We use git hooks through [pre-commit](https://pre-commit.com/) to enforce and automatically check some "rules". Please install them (`pre-commit install`) before to push any commit. | ||
|
||
See the relevant configuration file: `.pre-commit-config.yaml`. | ||
|