-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
55 lines (50 loc) · 2.24 KB
/
Copy pathruff.toml
File metadata and controls
55 lines (50 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ruff configuration for autolens_profiling.
#
# This repo is a collection of standalone profiling scripts, not a Python
# package — there is no pyproject.toml. A standalone ruff.toml at the
# repository root is the supported configuration location for that case
# (see https://docs.astral.sh/ruff/configuration/).
#
# Sister PyAuto* repos do not yet have a ruff config; this file is the
# greenfield baseline for the autolens_profiling repo. If the broader
# PyAutoLabs ecosystem later standardises on a shared ruff config, this
# file should be updated to match.
target-version = "py311"
line-length = 100
# Exclude generated / external folders.
extend-exclude = [
"results",
"dataset",
".venv",
"venv",
]
[lint]
# Conservative selection — catch real bugs without imposing a strict style.
# Profiling scripts use scientific patterns that can clash with stricter rule
# sets (long lines for table headers, `if __name__ == "__main__":` is rare
# because scripts run top-level, etc.).
select = [
"E", # pycodestyle errors
"F", # pyflakes (undefined names, unused imports)
"W", # pycodestyle warnings
"I", # isort (import order)
"UP", # pyupgrade (Python version idioms)
"B", # flake8-bugbear (likely bugs)
]
ignore = [
"E501", # long lines — common in scientific code; ruff format handles wrapping
"E402", # module-level imports not at top of file — profiling scripts often
# set env vars (NUMBA_CACHE_DIR etc.) before importing autolens
"F401", # unused imports — some scripts deliberately import-for-side-effect
# (e.g. `from autoconf import jax_wrapper # noqa: F401`)
"B008", # function call in default argument — common autofit pattern
"B905", # zip() without strict= — scripts zip equal-length lists they built
# themselves; threading strict= through adds noise, not safety
"B007", # unused loop-control variable — warm-up/repeat loops (`for _i in
# range(n)`) are the dominant pattern in timing code
]
[lint.per-file-ignores]
# build_readme.py uses dynamic re.sub callbacks that confuse some checkers.
"scripts/build_readme.py" = ["B023"] # function-uses-loop-variable
[format]
# Defaults: black-compatible. Nothing to override.