forked from lcmd-epfl/Q-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
103 lines (88 loc) · 3.19 KB
/
ruff.toml
File metadata and controls
103 lines (88 loc) · 3.19 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".pytest_cache",
".ruff_cache",
"qstack.egg-info",
"__init__.py",
]
line-length = 88
indent-width = 4
target-version = "py313"
[format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
#
# This is currently disabled by default, but it is planned for this
# to be opt-out in the future.
docstring-code-format = false
# Set the line length limit used when formatting code snippets in
# docstrings.
#
# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"
[lint]
allowed-confusables = ["ρ", "×", "–", "γ"]
select = [
"A", "E", "F", "B",
"S", "COM", "C4", "EXE", "ICN", "PIE", "PLR1714", "ARG",
"PERF", "FURB", "PLE", "TRY002", "W", "UP", "RUF", "SIM", "NPY",
"D",
#"FIX", "TD", # later
]
ignore = [
"E741", # ambiguous variable name
"E731", # do not assign lambda expression
"E501", # line length
"RUF015", # single element slice
"SIM3", # yoda condition
"SIM114", # combine if branches
"SIM108", # use ternary operator
"D105", # missing docstring in magic method
"D107", # missing docstring in __init__
"D203", # blank line required before class docstring
"D204", # blank line required after class docstring
"D213", # multi-line docstring summary should start at the second line
"D413", # missing blank line after last section
]
#preview = true
extend-select = ["DOC"]
extend-ignore = [
# pathlib
"FURB101", "FURB103",
# whitespaces
"E201", "E202", "E203", "E211",
"E221", "E222", "E225", "E226", "E228",
"E231", "E241", "E271", "E272",
# lambda
"FURB118",
]
[lint.per-file-ignores]
"qstack/spahm/rho/Dmatrix.py" = ["E702"] # multiple statements on one line (semicolon)
"qstack/spahm/rho/bond.py" = ["E711"] # comparison to `None` for np.array elements
"qstack/spahm/rho/compute_rho_spahm.py" = ["E711"] # comparison to `None` for np.array elements
"qstack/spahm/rho/bond_selected.py" = ["E711"] # comparison to `None` for np.array elements
"tests/*" = [
"S101", # use of assert
"S306", # use of mktemp
"D", "DOC",
]
"qstack/mathutils/xyz_integrals_sym.py" = ["D417"] # missing argument descriptions
"qstack/mathutils/xyz_integrals_float.py" = ["D417"] # missing argument descriptions
"qstack/reorder.py" = ["DOC502"] # raised exception is not explicitly raised
"qstack/orcaio.py" = ["DOC502"] # raised exception is not explicitly raised
"qstack/equio.py" = ["E251"] # unexpected spaces around keyword / parameter equals
"qstack/spahm/rho/dmb_rep_atom.py" = [
"DOC201", # `return` is not documented in docstring
"DOC102", # documented parameter is not in the function's signature
"D214", # section is over-indented
]