forked from geissdoerfer/shepherd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.ruff.toml
57 lines (49 loc) · 1.99 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
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
56
57
line-length = 100
target-version = "py310"
output-format = "concise"
[lint]
select = ["ALL"]
ignore = [
"N802", "N803", "N806", "N815", "N816", # naming (si-units should stay)
"PLR2004", # magic values
"TID252", # relative imports from parent
"PLR0904", "PLR0911", "PLR0912", "PLR0913", "PLR0915", # complexity
"C901", # complexity
"ANN101", "ANN102", # self & cls not type-annotated
"ANN401", # Any as valid type
"COM812", # trailing comma, same line
"TD002", "TD003", "TD005", "FIX002", # TODOs
"D105", "D107", # docstring in magic methods & init
"COM812", "ISC001", # conflicts with formatter
"D203", "D212", "D213", "D214", "D215", # conflicts with PEP257-convention (A)
"D404", "D405", "D406", "D407", "D408", "D409", # conflicts with PEP257-convention (B)
"D410", "D411", "D413", "D415", "D416", "D417", # conflicts with PEP257-convention (C)
"EM101", "TRY003", # xpt & strings
# TODO: for releasing now - do add documentation later
"D",
]
exclude= [ # external projects
"software/shepherd-datalib/*",
"software/shepherd-webservice/*",
"software/firmware/pru0-cython-module/*",
]
[lint.per-file-ignores]
"*/tests/**" = ["ARG", "S", "D", "SLF001", "T201"]
"*/examples/**" = ["INP001", "ERA001"] # no namespace + commented-out code
"software/shepherd-calibration/**" = ["ERA001"] # comments
"software/debug_analyze_time_sync/**" = ["ERA001", "S301"] # comments
"software/shepherd-devicetest/**" = ["ERA001", "ARG001", "PLW0603", "F405", "F403", "ANN001"]
"software/python-package/shepherd_sheep/shepherd_debug.py" = ["FBT001", "FBT002"]
"software/shepherd-calibration/shepherd_cal/**" = ["FBT003"] # rpc had trouble with named params
"docs/**" = ["INP001"]
[lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[lint.isort]
force-single-line = true
[lint.pyupgrade]
keep-runtime-typing = true
[lint.pydocstyle]
convention = "pep257"
[format] # per default like Black
docstring-code-format = true