@@ -9,6 +9,7 @@ authors = [
9
9
]
10
10
license = " MPL2.0"
11
11
readme = " README.md"
12
+ package-mode = false
12
13
13
14
[tool .poetry .dependencies ]
14
15
python = " ^3.11"
@@ -34,44 +35,114 @@ target-version = "py311"
34
35
35
36
[tool .ruff .lint ]
36
37
select = [
38
+ " A" ,
39
+ " ANN" ,
40
+ " ASYNC" ,
41
+ " B" ,
42
+ " BLE" ,
37
43
" C4" ,
44
+ " COM" ,
45
+ " DTZ" ,
46
+ " E" ,
47
+ " EM" ,
48
+ " ERA" ,
38
49
" F" ,
50
+ " FA" ,
51
+ " FBT" ,
52
+ " FURB" ,
39
53
" G" ,
40
54
" I" ,
55
+ " INP" ,
56
+ " ISC" ,
57
+ " NPY" ,
58
+ " PD" ,
59
+ " PERF" ,
60
+ " PGH" ,
61
+ " PIE" ,
62
+ " PLC" ,
63
+ " PLE" ,
64
+ " PLW" ,
41
65
" PTH" ,
66
+ " PYI" ,
67
+ " Q" ,
68
+ " Q003" ,
69
+ " RET" ,
70
+ " RSE" ,
42
71
" RUF" ,
72
+ " S" ,
43
73
" SIM" ,
44
- " TCH" ,
74
+ " SLOT" ,
75
+ " T20" ,
76
+ " TC" ,
77
+ " TID" ,
78
+ " TRY" ,
45
79
" UP" ,
46
- " W" ,
47
- " PERF" ,
48
- " ANN" ,
80
+ " YTT" ,
81
+ # "DOC", # not in a bot, please
49
82
]
50
83
ignore = [
84
+ " ANN401" ,
85
+ " ASYNC109" , # dpy commonly uses this parameter
86
+ " EM101" , # in this case this is okay
51
87
" F401" ,
52
88
" F402" ,
53
89
" F403" ,
54
90
" F405" ,
91
+ " INP001" , # due to how I load modules this results in annoyances
92
+ " PD011" , # this is not a numpy codebase
55
93
" PERF203" ,
94
+ " PLC0414" , # pyright ruling for `as` imports needed
95
+ " Q000" ,
56
96
" RUF001" ,
57
97
" RUF009" ,
98
+ " S101" , # assert is used for type checking in this codebase
58
99
" SIM105" ,
100
+ " TRY003" , # over-eager rule
101
+ " TRY301" , # unrealistic rule
59
102
" UP034" ,
60
103
" UP038" ,
61
- " ANN101" ,
62
- " ANN102" ,
63
- " ANN401" ,
64
104
]
105
+ unfixable = [
106
+ " E501" , # line length handled in other ways by ruff format
107
+ " ERA" , # Don't delete commented out code
108
+ ]
109
+
110
+ [tool .ruff .format ]
111
+ # Like Black, use double quotes for strings.
112
+ quote-style = " double"
113
+ # Like Black, indent with spaces, rather than tabs.
114
+ indent-style = " space"
115
+ # Like Black, respect magic trailing commas.
116
+ skip-magic-trailing-comma = false
117
+ # Like Black, automatically detect the appropriate line ending.
118
+ line-ending = " auto"
65
119
66
120
[tool .ruff .lint .isort ]
67
121
split-on-trailing-comma = true
68
122
combine-as-imports = true
69
123
124
+ [tool .ruff .lint .pydocstyle ]
125
+ convention = " numpy"
126
+
70
127
[tool .ruff .lint .flake8-annotations ]
71
128
allow-star-arg-any = true
72
129
130
+ [tool .ruff .lint .flake8-pytest-style ]
131
+ fixture-parentheses = false
132
+ mark-parentheses = false
133
+ parametrize-names-type = " csv"
134
+
73
135
[tool .ruff .lint .flake8-quotes ]
74
- inline-quotes = " single"
136
+ inline-quotes = " double"
137
+
138
+ [tool .ruff .lint .flake8-tidy-imports .banned-api ]
139
+ # https://discuss.python.org/t/problems-with-typeis/55410/6
140
+ # https://discuss.python.org/t/problems-with-typeis/55410/46
141
+ # Until what can go into a TypeIs/TypeGuard changes, these are just dangerous.
142
+ "typing.TypeIs".msg = " TypeIs is fundamentally unsafe, even when using it as described to be safe"
143
+ "typing.TypeGuard".msg = " TypeGuard is fundamentally unsafe"
144
+ "typing_extensions.TypeIs".msg = " TypeIs is fundamentally unsafe, even when using it as described to be safe"
145
+ "typing_extensions.TypeGuard".msg = " TypeGuard is fundamentally unsafe"
75
146
76
147
[tool .pyright ]
77
148
useLibraryCodeForTypes = true
0 commit comments