Skip to content

Commit 02f52f9

Browse files
committed
Ruff config, pytest config, pre-commit config
1 parent 83fb120 commit 02f52f9

3 files changed

Lines changed: 78 additions & 17 deletions

File tree

.flake8

Lines changed: 0 additions & 17 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
exclude: "^tests/example-data/.*"
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-ast
10+
- id: check-json
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.8.2
13+
hooks:
14+
- id: ruff
15+
name: ruff lint
16+
args: [--fix, --show-fixes]
17+
- id: ruff-format
18+
- repo: https://github.com/rbubley/mirrors-prettier # Update mirror as official mirror is deprecated
19+
rev: v3.4.2
20+
hooks:
21+
- id: prettier
22+
- repo: https://github.com/ComPWA/taplo-pre-commit
23+
rev: v0.9.3
24+
hooks:
25+
- id: taplo-format
26+
args: ["--option", "array_auto_collapse=false"]
27+
- repo: https://github.com/abravalheri/validate-pyproject
28+
rev: v0.23
29+
hooks:
30+
- id: validate-pyproject
31+
additional_dependencies: ["validate-pyproject-schema-store[all]"]

pyproject.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[tool.pytest.ini_options]
2+
addopts = ["--strict-config", "--strict-markers"]
3+
testpaths = ["tests"]
4+
xfail_strict = true
5+
minversion = "7"
6+
markers = [ # can be skipped by doing `pytest -m "not slow"` etc.
7+
"flaky: flaky tests",
8+
"slow: slow tests",
9+
]
10+
11+
filterwarnings = [
12+
"error",
13+
"default::DeprecationWarning",
14+
"error::DeprecationWarning:pyglider",
15+
]
16+
17+
[tool.ruff.lint]
18+
select = [
19+
"F", # pyflakes
20+
"I", # isort
21+
"E", # Error
22+
# "D", # pydocstyle
23+
# "B", # Bugbear
24+
# "UP", # pyupgrade
25+
# "LOG", # logging
26+
# "ICN", # import conventions
27+
# "G", # logging-format
28+
# "RUF", # ruff
29+
]
30+
31+
ignore = [
32+
# TODO: Remove
33+
"E402", # Module level import not at top of file
34+
35+
"F841", # Local variable `...` is assigned to but never used
36+
"E722", # Do not use bare `except`
37+
"E501", # Line too long (... > 88)
38+
"E741", # Ambiguous variable name: `l`
39+
]
40+
[tool.ruff.format]
41+
quote-style = "single"
42+
43+
[tool.ruff.lint.pydocstyle]
44+
convention = "numpy"
45+
46+
[tool.ruff.lint.isort]
47+
known-first-party = ["pyglider"]

0 commit comments

Comments
 (0)