-
Notifications
You must be signed in to change notification settings - Fork 11
/
ruff.toml
28 lines (24 loc) · 1.46 KB
/
ruff.toml
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
# https://docs.astral.sh/ruff/tutorial/#configuration
fix = true # automatically fix problems if possible
line-length = 120
# https://docs.astral.sh/ruff/linter/#rule-selection
[lint]
extend-select = ["RUF", "E", "F", "I", "UP", "N", "S", "BLE", "A", "C4", "T10", "ISC", "ICN", "PT",
"Q", "SIM", "TID", "ARG", "DTZ", "PD", "PGH", "PLC", "PLE", "PLR", "PLW", "PIE", "COM"] # Enable these rules
ignore = ["PLR0913", "PLR2004", "PLR0402", "COM812", "COM819", "SIM108", "ARG002", "ISC001", "S603", "S607", "S701"] # except for these specific errors
[lint.pylint]
# system_parameters.py has many file lookups that necessitate nested statements & branches
# Raise the allowed limits the least possible amount https://docs.astral.sh/ruff/settings/#pylint-max-branches
max-statements = 60
max-branches = 24
[lint.per-file-ignores]
"tests/*" = ["S101"] # assert statements are allowed in tests, and paths are safe
"geojson_modelica_translator/model_connectors/load_connectors/teaser.py" = ["PLR0915"]
# Lots of statements in the teaser post-processing. Don't think we can avoid it.
"geojson_modelica_translator/model_connectors/districts/district.py" = ["PLR0915", "PLR0912"]
# FIXME: The District.to_modelica method is large and probably should be broken into a few separate methods.
"geojson_modelica_translator/model_connectors/couplings/diagram.py" = ["E501"]
# Only needed for _parse_coupling_graph docstring
# https://docs.astral.sh/ruff/formatter/#configuration
[format]
# quote-style = "double"