Skip to content

Commit 7325f17

Browse files
nos1dot618claude
andcommitted
chore: add black, ruff, mypy and pre-commit configuration
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 875ff9b commit 7325f17

3 files changed

Lines changed: 76 additions & 0 deletions

File tree

‎.pre-commit-config.yaml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Install with `pre-commit install`; run on everything with `pre-commit run --all-files`.
2+
# The Python tools come from requirements-dev.txt, so CI and your machine use
3+
# the same versions.
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v5.0.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: mixed-line-ending
11+
args: [--fix=lf]
12+
- id: check-merge-conflict
13+
- id: check-toml
14+
- id: check-yaml
15+
- id: check-added-large-files
16+
17+
- repo: local
18+
hooks:
19+
- id: black
20+
name: black
21+
entry: black
22+
language: system
23+
types: [python]
24+
- id: ruff
25+
name: ruff
26+
entry: ruff check --fix
27+
language: system
28+
types: [python]
29+
- id: mypy
30+
name: mypy
31+
entry: mypy
32+
language: system
33+
types: [python]
34+
pass_filenames: false

‎pyproject.toml‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Settings for the tools that check the build scripts. The site itself is
2+
# built with `python build.py`; it isn't a package.
3+
4+
[project]
5+
name = "lambda-discipline-website"
6+
version = "0"
7+
requires-python = ">=3.11"
8+
9+
[tool.black]
10+
target-version = ["py311"]
11+
12+
[tool.ruff]
13+
target-version = "py311"
14+
extend-exclude = [".cache", "_site"]
15+
16+
[tool.ruff.lint]
17+
select = [
18+
"E", "W", "F", # pycodestyle and pyflakes
19+
"I", # import order
20+
"UP", # modern syntax
21+
"B", # likely bugs
22+
"SIM", # simplifications
23+
"RUF", # ruff's own rules
24+
]
25+
ignore = [
26+
"E501", # black decides line length
27+
]
28+
29+
[tool.mypy]
30+
files = ["build.py", "lbd_lexer.py"]
31+
python_version = "3.11"
32+
strict = true
33+
# Some ignores in the scripts are for editors' type checkers, not mypy.
34+
warn_unused_ignores = false

‎requirements-dev.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Tools for checking the build scripts; CI runs the same versions.
2+
-r requirements.txt
3+
black==26.10.1
4+
mypy==2.4.0
5+
pre-commit==4.6.0
6+
ruff==0.17.1
7+
types-Markdown==3.10.2.20261007
8+
types-Pygments==2.21.0.20260819

0 commit comments

Comments
 (0)