-
-
Notifications
You must be signed in to change notification settings - Fork 570
Expand file tree
/
Copy pathruff.toml
More file actions
48 lines (42 loc) · 2.22 KB
/
Copy pathruff.toml
File metadata and controls
48 lines (42 loc) · 2.22 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
# Ruff config for the GeoLibre monorepo's Python (python/ + backend/).
# Scope is deliberately narrow: formatting + import sorting + the basic
# pyflakes/pep8 error classes. Heavier rule sets (UP, B, SIM) are intentionally
# left off to avoid a large churny cleanup across the existing codebase, mirroring
# the same philosophy documented in eslint.config.mjs.
line-length = 100
# python/ requires >=3.11, backend/geolibre_server requires >=3.10; target the
# lower bound so neither side gets modern-syntax rewrites it can't run on.
target-version = "py310"
extend-exclude = [
# Bundled web app baked into the Python wheel; generated, not hand-edited.
"python/src/geolibre/static",
# Staged into JupyterLite by scripts/build-jupyterlite.mjs; generated copies.
"apps/geolibre-desktop/jupyterlite",
"apps/geolibre-desktop/public/jupyterlite",
# ruff's own cache directory (kept explicit even though ruff excludes it by
# default, so the intent survives any future change to the default list).
".ruff_cache",
]
[lint]
# F = Pyflakes (real bugs: unused imports/vars, undefined names).
# I = isort (import ordering; the repo already groups stdlib/third-party/first-party).
# W = pycodestyle whitespace warnings.
# E = pycodestyle errors (E501 fires at the top-level line-length, 100).
select = ["F", "I", "W", "E"]
[lint.isort]
known-first-party = ["geolibre", "geolibre_server"]
[lint.per-file-ignores]
# These files embed long string literals that must NOT be reformatted:
# - whitebox.py: a Python script passed as a string to the Whitebox subprocess
# (one statement per line; breaking it would change runtime behavior).
# - test_map.py: inline GeoJSON FeatureCollection data literals.
# The formatter already skips string contents; these ignores stop the linter's
# E501 from flagging lines whose only "violation" is a long string.
"backend/geolibre_server/geolibre_server/app/whitebox.py" = ["E501"]
"python/tests/test_map.py" = ["E501"]
[format]
# The repo uses double-quoted strings throughout (see basemaps.py, vector.py).
quote-style = "double"
# Magic trailing comma drives expansion of collection literals across lines,
# matching the way the repo already formats long call signatures and dict literals.
skip-magic-trailing-comma = false