@@ -108,8 +108,6 @@ test = [
108108dev = [
109109 " mypy~=1.19.1" ,
110110 " pre-commit~=4.5.0" ,
111- " flake8~=7.3.0" ,
112- " flake8-pyproject~=1.2.3" ,
113111 " sqlalchemy[mypy]~=2.0.44" ,
114112 " types-jwcrypto~=1.5.0" ,
115113]
@@ -137,6 +135,44 @@ target-version = "py311"
137135line-length = 120
138136extend-exclude = [" docs/" , " Makefile" ]
139137
138+ [tool .ruff .lint ]
139+ select = [" ALL" ]
140+ ignore = [" ARG" , " ANN" , " A002" , " COM812" , " D" , " TD" , " FIX002" ]
141+
142+ [tool .ruff .lint .per-file-ignores ]
143+ "syncmaster/db/migrations/versions/2025-08-10_0012_update_ts.py" = [" E501" ]
144+ "syncmaster/db/migrations/*" = [" N999" ]
145+ "syncmaster/db/models/*" = [" TC" ]
146+ "syncmaster/db/repositories/*" = [" TC" , " PLR0913" ]
147+ "syncmaster/schemas/*" = [" TC" ]
148+
149+ "tests/*" = [
150+ " S" ,
151+ " A" ,
152+ " E501" ,
153+ " FBT001" ,
154+ " FBT002" ,
155+ " PLR2004" ,
156+ " PLR0913" ,
157+ " SLF001" ,
158+ " FIX002" ,
159+ " PERF401" ,
160+ " RET504" ,
161+ " PLC0415" ,
162+ " C408" ,
163+ ]
164+ "tests/resources/file_df_connection/test_data.py" = [" RUF001" ]
165+
166+ [tool .ruff .lint .flake8-pytest-style ]
167+ parametrize-names-type = " list"
168+ parametrize-values-type = " list"
169+ parametrize-values-row-type = " tuple"
170+
171+ [tool .ruff .lint .flake8-quotes ]
172+ inline-quotes = " double"
173+ multiline-quotes = " double"
174+ docstring-quotes = " double"
175+
140176[tool .mypy ]
141177python_version = " 3.11"
142178plugins = [" pydantic.mypy" , " sqlalchemy.ext.mypy.plugin" ]
@@ -240,217 +276,6 @@ exclude_lines = [
240276 " def downgrade\\ (\\ )" ,
241277]
242278
243- [tool .flake8 ]
244- jobs = 4
245- # We don't control ones who use our code
246- i-control-code = false
247- # Max of noqa in a module
248- max-noqa-comments = 10
249- max-annotation-complexity = 4
250- max-returns = 5
251- max-awaits = 5
252- max-local-variables = 20
253- max-name-length = 65
254- # Max of expressions in a function
255- max-expressions = 15
256- # Max args in a function
257- max-arguments = 15
258- # Max classes and functions in a single module
259- max-module-members = 35
260- max-import-from-members = 35
261- max-methods = 25
262- # Max line complexity measured in AST nodes
263- max-line-complexity = 24
264- # Max Jones Score for a module: the median of all lines complexity sum
265- max-jones-score = 15
266- # Max amount of cognitive complexity per function
267- max-cognitive-score = 20
268- # Max amount of cognitive complexity per module
269- max-cognitive-average = 25
270- max-imports = 25
271- max-imported-names = 50
272- # Max of expression usages in a module
273- max-module-expressions = 15
274- # Max of expression usages in a function
275- max-function-expressions = 15
276- max-base-classes = 5
277- max-decorators = 6
278- # Max of repeated string constants in your modules
279- max-string-usages = 15
280- max-try-body-length = 15
281- max-asserts = 15
282- # Max number of access level in an expression
283- max-access-level = 6
284- # maximum number of public instance attributes
285- max-attributes = 20
286-
287- max-line-length = 120
288- max-doc-length = 120
289-
290- # https://pypi.org/project/flake8-quotes/
291- inline-quotes = " double"
292- multiline-quotes = " double"
293- docstring-quotes = " double"
294-
295- # https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
296- show-source = true
297- # Print total number of errors
298- count = true
299- statistics = true
300-
301- exclude = [
302- " .tox" ,
303- " migrations" ,
304- " dist" ,
305- " build" ,
306- " hadoop_archive_plugin" ,
307- " virtualenv" ,
308- " venv" ,
309- " venv36" ,
310- " ve" ,
311- " .venv" ,
312- " tox.ini" ,
313- " docker" ,
314- " Jenkinsfile" ,
315- " dags" ,
316- " setup.py" ,
317- " docs"
318- ]
319- rst-directives = [
320- " autosummary" ,
321- " data" ,
322- " currentmodule" ,
323- " deprecated" ,
324- " glossary" ,
325- " moduleauthor" ,
326- " plot" ,
327- " testcode" ,
328- " versionadded" ,
329- " versionchanged"
330- ]
331- # https://github.com/peterjc/flake8-rst-docstrings/pull/16
332- rst-roles = [
333- " attr" ,
334- " class" ,
335- " func" ,
336- " meth" ,
337- " mod" ,
338- " obj" ,
339- " ref" ,
340- " term" ,
341- " py:func" ,
342- " py:mod"
343- ]
344-
345- ignore = [
346- " ANN" ,
347- " FI1" ,
348- # Found upper-case constant in a class: DB_URL
349- " WPS115" ,
350- # Found statement that has no effect
351- " WPS428" ,
352- # Found `f` string [opinionated]
353- " WPS305" ,
354- # Found class without a base class (goes against PEP8) [opinionated]
355- " WPS306" ,
356- # Found line break before binary operator [goes against PEP8] [opinionated]
357- " W503" ,
358- # Found multiline conditions [opinionated]
359- " WPS337" ,
360- # Found mutable module constant [opinionated]
361- " WPS407" ,
362- # Found empty module:
363- " WPS411" ,
364- # Found nested import [opinionated]
365- " WPS433" ,
366- # Found negated condition [opinionated]
367- " WPS504" ,
368- # Found implicit `.get()` dict usage
369- " WPS529" ,
370- # Docstrings [opinionated]
371- " D" ,
372- # string does contain unindexed parameters'
373- " P101" ,
374- " P103" ,
375- # Found implicit string concatenation [optional]
376- " WPS326" ,
377- # Found wrong function call: locals'
378- " WPS421" ,
379- # module level import not at top of file
380- " E402" ,
381- # Document or section may not begin with a transition.
382- " RST399" ,
383- # Error in "code" directive
384- " RST307" ,
385- # Found `%` string formatting
386- " WPS323" ,
387- # doc line too long
388- " W505" ,
389- # line too long
390- " E501" ,
391- # Found wrong module name: util
392- " WPS100" ,
393- # Found wrong keyword: pass
394- " WPS420" ,
395- # Found incorrect node inside `class` body: pass
396- " WPS604" ,
397- # Found wrong variable name: data
398- " WPS110" ,
399- # Found builtin shadowing: id
400- " WPS125" ,
401- # Found too short name: e < 2
402- " WPS111" ,
403- # Found a line that starts with a dot
404- " WPS348" ,
405- # first argument of a method should be named 'self'
406- " N805" ,
407- # Found `finally` in `try` block without `except`
408- " WPS501" ,
409- # Wrong multiline string usage: textwrap.dedent + multiline comment
410- " WPS462" ,
411- # Found incorrect multi-line string: 3-quoted docstring with just one line
412- " WPS322" ,
413- # https://github.com/wemake-services/wemake-python-styleguide/issues/2847
414- # E704 multiple statements on one line (def)
415- " E704" ,
416- # WPS220 Found too deep nesting: 34 > 20
417- " WPS220" ,
418- # WPS412 Found `__init__.py` module with logic
419- " WPS412" ,
420- # WPS410 Found wrong metadata variable: __all__
421- " WPS410" ,
422- ]
423-
424- per-file-ignores = [
425- # WPS102 Found incorrect module name pattern
426- # WPS432 Found magic number: 256
427- # WPS226 Found string literal over-use: value > 15
428- # WPS342 Found implicit raw string
429- " *migrations/*.py:WPS102,WPS432,WPS226,WPS342" ,
430- " *db/models/*.py:WPS102,WPS432,WPS342" ,
431- " *db/mixins/*.py:WPS102,WPS432" ,
432- # WPS432 Found magic number: 180
433- " *settings/*.py:WPS432" ,
434- # WPS404 Found complex default value
435- " *server/api/*.py:WPS404" ,
436- # WPS237 Found a too complex `f` string
437- " *exceptions/*.py:WPS237" ,
438- " *exceptions/__init__.py:F40,WPS410" ,
439- # WPS201 Found module with too many imports: 30 > 25
440- # WPS203 Found module with too many imported names: 55 > 50
441- " syncmaster/worker/controller.py:WPS201,WPS203" ,
442- # TAE001 too few type annotations
443- # WPS231 Found function with too much cognitive complexity
444- # S101 Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
445- # WPS442 Found outer scope names shadowing
446- # WPS432 Found magic number
447- # WPS334 Found reversed complex comparison
448- # WPS218 Found too many `assert` statements: 19 > 15
449- # WPS226 Found string literal over-use: value > 15
450- # WPS118 Found too long name:
451- " *tests/*.py:TAE001,WPS231,S101,WPS442,WPS432,WPS334,WPS218,WPS226,WPS118" ,
452- ]
453-
454279[tool .towncrier ]
455280name = " Syncmaster"
456281package = " syncmaster"
0 commit comments