@@ -20,7 +20,7 @@ readme = "README.md"
20
20
exclude = [' tests/' ]
21
21
22
22
[tool .poetry .dependencies ]
23
- python = " ^ 3.9,<3.14"
23
+ python = " >= 3.9,<3.14"
24
24
boto3 = " ^1.27.33"
25
25
26
26
[tool .poetry .group .dev .dependencies ]
@@ -42,19 +42,40 @@ extend-exclude = ["env", "runtime"]
42
42
43
43
[tool .ruff .lint ]
44
44
select = [
45
+ " A" , # flake8-builtins
45
46
" ASYNC" , # flake8-async
47
+ " B" , # flake8-bugbear
46
48
" C4" , # flake8-comprehensions
47
49
" D" , # pydocstyle,
50
+ " DTZ" , # flake8-datetimez,
48
51
" E" , # pycodestyle errors
49
52
" W" , # pycodestyle warnings
50
- " W" , # pycodestyle
51
53
" F" , # pyflakes
52
54
" I" , # isort
53
55
" PL" , # pylint
54
56
" RUF" , # ruff
55
57
" S" , # flake8-bandit
58
+ " T20" , # flake8-print
56
59
" SIM" , # flake8-simplify
57
60
" UP" , # pyupgrade
61
+ " TC" , # flake8-type-checking
62
+ " BLE" , # flake8-blind-except
63
+ " FA" , # flake8-future-annotations
64
+ " FIX" , # flake8-fixme
65
+ " ICN" , # flake8-import-conventions
66
+ " LOG" , # flake8-logging
67
+ " G" , # flake8-logging-format
68
+ " RET" , # flake8-logging-return
69
+ " ISC" , # flake8-implicit-str-concat
70
+ " INP" , # flake8-no-pep420
71
+ " PIE" , # flake8-pie
72
+ " PT" , # flake8-pytest-style
73
+ " TID" , # flake8-tidy-imports
74
+ " PTH" , # flake8-user-pathlib
75
+ " PERF" , # perflint
76
+ " FURB" , # refurb
77
+ " PGH" , # pygrep-hooks
78
+ " PYI" , # flake8-pyi
58
79
]
59
80
60
81
ignore = [
@@ -68,127 +89,22 @@ ignore = [
68
89
" D105" ,
69
90
" D107" ,
70
91
# These need to be fixed.
71
- " D202" ,
72
92
" D205" ,
73
93
" D400" ,
74
94
" D401" ,
75
95
76
96
# # E / W - pycodestyle ##
77
97
" E501" , # line too long
78
- " E203" , # whitespace-before-punctuation
79
- " E741" , # ambiguous variable name
80
98
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
99
+ # ## PL - pylint ##
103
100
" PLR0913" , # too-many-arguments
104
101
" PLR2004" , # magic-value-comparison
105
- " PLR5501" , # collapsible-else-if
106
102
" 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
-
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
103
120
104
" 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
126
105
" S301" , # suspicious-pickle-usage
127
- " S303" , # suspicious-insecure-hash-usage
128
- " S310" , # suspicious-url-open-usage
129
106
" 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
107
]
147
108
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
109
[tool .ruff .lint .pydocstyle ]
189
110
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