@@ -68,127 +68,22 @@ ignore = [
68
68
" D105" ,
69
69
" D107" ,
70
70
# These need to be fixed.
71
- " D202" ,
72
71
" D205" ,
73
72
" D400" ,
74
73
" D401" ,
75
74
76
75
# # E / W - pycodestyle ##
77
76
" E501" , # line too long
78
- " E203" , # whitespace-before-punctuation
79
- " E741" , # ambiguous variable name
80
77
81
- # # PL - pylint ##
82
- # Commented-out rules are rules that we disable in pylint but are not supported by ruff yet.
83
-
84
- # Import order issues
85
- # "PLC0411", # wrong-import-order
86
- # "PLC0412", # wrong-import-position
87
- " PLC0414" , # ungrouped-imports
88
-
89
- # Documentation issues
90
- # "C0114", # missing-module-docstring
91
-
92
- # Complexity issues
93
- # "PLR0904", # too-many-public-methods
94
- # "PLC0302", # too-many-lines
95
- # "PLR1702", # too-many-nested-blocks
96
- # "PLR0902", # too-many-instance-attributes
97
- " PLR0911" , # too-many-return-statements
98
- " PLR0915" , # too-many-statements
99
- " PLR0912" , # too-many-branches
100
- # "PLR0903", # too-few-public-methods
101
- # "PLR0914", # too-many-locals
102
- # "PLC0301", # line-too-long
78
+ # ## PL - pylint ##
103
79
" PLR0913" , # too-many-arguments
104
80
" PLR2004" , # magic-value-comparison
105
- " PLR5501" , # collapsible-else-if
106
81
" PLW0603" , # global-statement
107
- " PLW2901" , # redefined-loop-name
108
- " PLC1901" , # compare-to-empty-string
109
-
110
- # # RUF - ruff ##
111
- " RUF001" , # ambiguous-unicode-character-string
112
- " RUF002" , # ambiguous-unicode-character-docstring
113
- " RUF003" , # ambiguous-unicode-character-comment
114
- " RUF012" , # mutable-class-default
115
82
116
- # Enable when Poetry supports PEP 621 and we migrate our confguration to it.
117
- # See: https://github.com/python-poetry/poetry-core/pull/567
118
- " RUF200" ,
119
-
120
- " S101" , # assert
121
- " S104" , # hardcoded-bind-all-interfaces
122
- " S105" , # hardcoded-password-string
123
- " S106" , # hardcoded-password-func-arg
124
- " S107" , # hardcoded-password-default
125
- " S110" , # try-except-pass
83
+ # "S101", # assert
126
84
" S301" , # suspicious-pickle-usage
127
- " S303" , # suspicious-insecure-hash-usage
128
- " S310" , # suspicious-url-open-usage
129
85
" S311" , # suspicious-non-cryptographic-random-usage
130
- " S324" , # hashlib-insecure-hash-function
131
- " S603" , # subprocess-without-shell-equals-true
132
- " S607" , # start-process-with-partial-path
133
- " S608" , # hardcoded-sql-expression
134
-
135
- # # SIM - flake8-simplify ##
136
- " SIM102" , # collapsible-if
137
- " SIM105" , # suppressible-exception
138
- " SIM108" , # if-else-block-instead-of-if-exp
139
- " SIM114" , # if-with-same-arms
140
- " SIM116" , # if-else-block-instead-of-dict-lookup
141
- " SIM117" , # multiple-with-statements
142
-
143
- # Enable when the rule is out of preview and false-positives are handled.
144
- # See: https://docs.astral.sh/ruff/rules/in-dict-keys/
145
- " SIM118" , # in-dict-keys
146
86
]
147
87
148
- [tool .ruff .lint .per-file-ignores ]
149
- # These files have only a bunch of imports in them to force code loading.
150
- "todoist/workers/todoist_handlers.py" = [" F401" ]
151
- "todoist/signals/signal_handlers.py" = [" F401" ]
152
- "todoist/workers/scripts_handlers.py" = [" F401" ]
153
- "scripts/**" = [" S101" ] # Allow assert statement in scripts.
154
- "tests/**" = [" S101" ] # Allow assert statement in tests.
155
-
156
- # We allow module-level imports to be not at the top of scripts, cron,
157
- # and configs because we initialize Todoist environment there
158
- "todoist/*/scripts/*.py" = [" E402" ]
159
- "todoist/*/cron/*.py" = [" E402" ]
160
- "scripts/*.py" = [" E402" ]
161
- "configs/*.py" = [" E402" ]
162
-
163
- # To import all fixtures from other conftests.
164
- "conftest.py" = [" F401" , " F403" ]
165
- # To import select fixtures from non-local conftests.
166
- # Importing and using the fixture makes it be shadowed.
167
- "test_*.py" = [" F401" , " F811" ]
168
-
169
- "tests/minimal/conftest.py" = [" E402" , " F401" , " F403" ]
170
-
171
- [tool .ruff .lint .isort ]
172
- section-order = [
173
- " future" ,
174
- " standard-library" ,
175
- " third-party" ,
176
- " parts" ,
177
- " first-party" ,
178
- " td-models" ,
179
- " td-apps" ,
180
- " local-folder" ,
181
- ]
182
-
183
- [tool .ruff .lint .isort .sections ]
184
- "parts" = [" parts" ]
185
- "td-models" = [" todoist.models" ]
186
- "td-apps" = [" todoist.apps" ]
187
-
188
88
[tool .ruff .lint .pydocstyle ]
189
89
convention = " pep257"
190
-
191
- [tool .ruff .lint .pyupgrade ]
192
- # Required by tools like Pydantic that use type information at runtime.
193
- # https://github.com/asottile/pyupgrade/issues/622#issuecomment-1088766572
194
- keep-runtime-typing = true
0 commit comments