@@ -17,72 +17,6 @@ ignore-words = ".azure-pipelines/scripts/codeScan/codespell/inc_dict.txt"
17
17
18
18
19
19
[tool .ruff ]
20
- # Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
21
- select = [" E" , " F" ]
22
- ignore = [
23
- " E402" , # Module level import not at top of file
24
- " E501" , # Line too long (121 > 120 characters)
25
- " E721" , # Do not compare types, use isinstance()
26
- " E722" , # Do not use bare except
27
- " E731" , # Do not assign a lambda expression, use a def
28
- " E741" , # Do not use variables named ‘l’, ‘O’, or ‘I’
29
- " F401" , # {name} imported but unused
30
- " F403" , # from {name} import * used; unable to detect undefined names
31
- " F405" , # {name} may be undefined, or defined from star imports
32
- " F841" , # Local variable is assigned to but never used{name}
33
- ]
34
-
35
- ignore-init-module-imports = true
36
-
37
- # Allow autofix for all enabled rules (when `--fix`) is provided.
38
- fixable = [
39
- " A" ,
40
- " B" ,
41
- " C" ,
42
- " D" ,
43
- " E" ,
44
- " F" ,
45
- " G" ,
46
- " I" ,
47
- " N" ,
48
- " Q" ,
49
- " S" ,
50
- " T" ,
51
- " W" ,
52
- " ANN" ,
53
- " ARG" ,
54
- " BLE" ,
55
- " COM" ,
56
- " DJ" ,
57
- " DTZ" ,
58
- " EM" ,
59
- " ERA" ,
60
- " EXE" ,
61
- " FBT" ,
62
- " ICN" ,
63
- " INP" ,
64
- " ISC" ,
65
- " NPY" ,
66
- " PD" ,
67
- " PGH" ,
68
- " PIE" ,
69
- " PL" ,
70
- " PT" ,
71
- " PTH" ,
72
- " PYI" ,
73
- " RET" ,
74
- " RSE" ,
75
- " RUF" ,
76
- " SIM" ,
77
- " SLF" ,
78
- " TCH" ,
79
- " TID" ,
80
- " TRY" ,
81
- " UP" ,
82
- " YTT" ,
83
- ]
84
- unfixable = []
85
-
86
20
# Exclude a variety of commonly ignored directories.
87
21
exclude = [
88
22
" .bzr" ,
@@ -91,35 +25,85 @@ exclude = [
91
25
" .git" ,
92
26
" .git-rewrite" ,
93
27
" .hg" ,
28
+ " .ipynb_checkpoints" ,
94
29
" .mypy_cache" ,
95
30
" .nox" ,
96
31
" .pants.d" ,
32
+ " .pyenv" ,
33
+ " .pytest_cache" ,
97
34
" .pytype" ,
98
35
" .ruff_cache" ,
99
36
" .svn" ,
100
37
" .tox" ,
101
38
" .venv" ,
39
+ " .vscode" ,
102
40
" __pypackages__" ,
103
41
" _build" ,
104
42
" buck-out" ,
105
43
" build" ,
106
44
" dist" ,
107
45
" node_modules" ,
46
+ " site-packages" ,
108
47
" venv" ,
109
48
]
110
49
111
50
# Same as Black.
112
51
line-length = 120
52
+ indent-width = 4
53
+
54
+ # Assume Python 3.10
55
+ target-version = " py310"
56
+
57
+ [tool .ruff .lint ]
58
+ # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
59
+ # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
60
+ # McCabe complexity (`C901`) by default.
61
+ select = [" E4" , " E7" , " E9" , " F" ]
62
+ ignore = [
63
+ " E402" , # Module level import not at top of file
64
+ " E501" , # Line too long (121 > 120 characters)
65
+ " E721" , # Do not compare types, use isinstance()
66
+ " E722" , # Do not use bare except
67
+ " E731" , # Do not assign a lambda expression, use a def
68
+ " E741" , # Do not use variables named ‘l’, ‘O’, or ‘I’
69
+ " F401" , # {name} imported but unused
70
+ " F403" , # from {name} import * used; unable to detect undefined names
71
+ " F405" , # {name} may be undefined, or defined from star imports
72
+ " F841" , # Local variable is assigned to but never used{name}
73
+ ]
74
+
75
+ # Allow fix for all enabled rules (when `--fix`) is provided.
76
+ fixable = [" ALL" ]
77
+ unfixable = []
113
78
114
79
# Allow unused variables when underscore-prefixed.
115
80
dummy-variable-rgx = " ^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
116
81
117
- # Assume Python 3.10.
118
- target-version = " py310"
82
+ ignore-init-module-imports = true
83
+
84
+ [tool .ruff .format ]
85
+ # Like Black, use double quotes for strings.
86
+ quote-style = " double"
87
+
88
+ # Like Black, indent with spaces, rather than tabs.
89
+ indent-style = " space"
90
+
91
+ # Like Black, respect magic trailing commas.
92
+ skip-magic-trailing-comma = false
93
+
94
+ # Like Black, automatically detect the appropriate line ending.
95
+ line-ending = " auto"
119
96
120
- [tool .ruff .per-file-ignores ]
121
- "**/__init__.py" = [" F401" ]
97
+ # Enable auto-formatting of code examples in docstrings. Markdown,
98
+ # reStructuredText code/literal blocks and doctests are all supported.
99
+ #
100
+ # This is currently disabled by default, but it is planned for this
101
+ # to be opt-out in the future.
102
+ docstring-code-format = false
122
103
123
- [tool .ruff .mccabe ]
124
- # Unlike Flake8, default to a complexity level of 10.
125
- max-complexity = 10
104
+ # Set the line length limit used when formatting code snippets in
105
+ # docstrings.
106
+ #
107
+ # This only has an effect when the `docstring-code-format` setting is
108
+ # enabled.
109
+ docstring-code-line-length = " dynamic"
0 commit comments