1
0
Fork 0
mirror of https://github.com/qurator-spk/modstool.git synced 2025-06-25 19:49:54 +02:00

⚙ Add pre-commit config + docs

This commit is contained in:
Mike Gerber 2025-06-13 18:15:42 +02:00
parent 76b36cb0ca
commit 62a02ff7e4
4 changed files with 85 additions and 0 deletions

35
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,35 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- id: check-ast
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
hooks:
- args:
- --fix
- --exit-non-zero-on-fix
id: ruff
- repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
rev: v0.7.0
hooks:
- id: pre-commit-update
- repo: https://github.com/dhatim/python-license-check
rev: 0.9.3
hooks:
- id: liccheck
language: system

View file

@ -15,3 +15,10 @@ To run a test with profiling:
```
pytest --profile-svg -k test_page_info
```
# How to use pre-commit
This project optionally uses [pre-commit](https://pre-commit.com) to check commits. To use it:
- Install pre-commit, e.g. `pip install -r requirements-dev.txt`
- Install the repo-local git hooks: `pre-commit install`

View file

@ -44,3 +44,42 @@ optional-dependencies.dev = {file = ["requirements-dev.txt"]}
[tool.setuptools.packages.find]
where = ["src"]
[tool.ruff.lint]
select = ["E", "F", "I"]
[tool.liccheck]
authorized_licenses = [
"bsd",
"new bsd",
"bsd license",
"new bsd license",
"simplified bsd",
"apache",
"apache 2.0",
"apache software license",
"apache software",
"apache license 2.0",
"gnu lgpl",
"lgpl with exceptions or zpl",
"GNU Library or Lesser General Public License (LGPL)",
"GNU Lesser General Public License v3 (LGPLv3)",
"GNU Lesser General Public License v2 or later (LGPLv2+)",
"mit",
"mit license",
"mit-cmu",
"python software foundation",
"psf",
"psf-2.0",
"Historical Permission Notice and Disclaimer (HPND)",
"public domain",
'The Unlicense (Unlicense)',
"isc",
"ISC License (ISCL)",
'Mozilla Public License 2.0 (MPL 2.0)',
]
unauthorized_licenses = [
"gpl v3",
]

View file

@ -7,3 +7,7 @@ mypy
types-lxml
types-tqdm
pandas-stubs
pre-commit
setuptools
liccheck