Skip to content

Commit 8bcefee

Browse files
committed
chg: use pylic in pre-commit
1 parent 028a06f commit 8bcefee

File tree

4 files changed

+247
-3
lines changed

4 files changed

+247
-3
lines changed

.pre-commit-config.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
default_stages: [pre-commit]
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-json
10+
- id: check-toml
11+
- id: check-xml
12+
- id: check-yaml
13+
- id: debug-statements
14+
- id: check-builtin-literals
15+
- id: check-case-conflict
16+
- id: check-docstring-first
17+
- id: detect-private-key
18+
# Prevent committing inline conflict markers
19+
- id: check-merge-conflict
20+
args: [--assume-in-merge]
21+
22+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
23+
rev: v2.16.0
24+
hooks:
25+
- id: pretty-format-toml
26+
args: [--autofix]
27+
exclude: ^uv\.lock$
28+
29+
- repo: https://github.com/Yelp/detect-secrets
30+
rev: v1.5.0
31+
hooks:
32+
- id: detect-secrets
33+
args: [--exclude-files=django/src/fixtures/users.json]
34+
35+
- repo: local
36+
hooks:
37+
# Prevent committing .rej files
38+
- id: forbidden-files
39+
name: forbidden files
40+
entry: found Copier update rejection files
41+
description:
42+
review and remove .rej files before
43+
merging.
44+
language: fail
45+
files: "\\.rej$"
46+
47+
- repo: https://github.com/woodruffw/zizmor-pre-commit
48+
rev: v1.23.1
49+
hooks:
50+
- id: zizmor
51+
52+
- repo: https://github.com/astral-sh/ruff-pre-commit
53+
rev: v0.15.7
54+
hooks:
55+
- id: ruff
56+
- id: ruff-format
57+
58+
- repo: https://github.com/astral-sh/uv-pre-commit
59+
rev: 0.10.12
60+
hooks:
61+
- id: uv-lock
62+
63+
- repo: local
64+
hooks:
65+
- id: deptry
66+
name: deptry
67+
entry: uv run deptry .
68+
language: system
69+
types: [python]
70+
pass_filenames: false
71+
- id: pylic
72+
name: pylic
73+
entry: uv run pylic check --allow-extra-safe-licenses
74+
language: system
75+
types: [python]
76+
pass_filenames: false

pyproject.toml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[dependency-groups]
22
dev = [
3-
"deptry"
3+
"deptry",
4+
"pylic"
45
]
56

67
[project]
@@ -43,6 +44,27 @@ extend_exclude = ["python/"]
4344
DEP001 = ["jinja2"]
4445
DEP003 = ["jinja2"]
4546

47+
[tool.pylic]
48+
safe_licenses = [
49+
"Apache Software License",
50+
"Apache License 2.0",
51+
"Apache-2.0",
52+
"BSD License",
53+
"BSD-2-Clause",
54+
"BSD-3-Clause",
55+
"MIT License",
56+
"MIT",
57+
"Python Software Foundation License",
58+
"PSF-2.0",
59+
"Mozilla Public License 2.0 (MPL 2.0)",
60+
"MPL-2.0",
61+
"ISC License (ISCL)",
62+
"ISC",
63+
"The Unlicense (Unlicense)",
64+
"Unlicense"
65+
]
66+
unsafe_packages = []
67+
4668
[tool.ruff]
4769
fix = true
4870

python/pyproject.toml.jinja

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ version = "0.1.0"
2626
[dependency-groups]
2727
dev = [
2828
"deptry",
29+
"pylic",
2930
{% if notebook %}
3031
{% if notebook_type == "jupyter" %}
3132
"ipykernel",
@@ -36,6 +37,27 @@ dev = [
3637
[tool.deptry]
3738
known_first_party = ["src"]
3839

40+
[tool.pylic]
41+
safe_licenses = [
42+
"Apache Software License",
43+
"Apache License 2.0",
44+
"Apache-2.0",
45+
"BSD License",
46+
"BSD-2-Clause",
47+
"BSD-3-Clause",
48+
"MIT License",
49+
"MIT",
50+
"Python Software Foundation License",
51+
"PSF-2.0",
52+
"Mozilla Public License 2.0 (MPL 2.0)",
53+
"MPL-2.0",
54+
"ISC License (ISCL)",
55+
"ISC",
56+
"The Unlicense (Unlicense)",
57+
"Unlicense",
58+
]
59+
unsafe_packages = []
60+
3961
[tool.ruff]
4062
fix = true
4163

uv.lock

Lines changed: 126 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)