15
15
# limitations under the License.
16
16
17
17
18
- # # ruff settings ##
19
- [tool .ruff ]
20
- # Exclude a variety of commonly ignored directories.
21
- exclude = [
22
- " .bzr" ,
23
- " .direnv" ,
24
- " .eggs" ,
25
- " .git" ,
26
- " .git-rewrite" ,
27
- " .hg" ,
28
- " .ipynb_checkpoints" ,
29
- " .mypy_cache" ,
30
- " .nox" ,
31
- " .pants.d" ,
32
- " .pyenv" ,
33
- " .pytest_cache" ,
34
- " .pytype" ,
35
- " .ruff_cache" ,
36
- " .svn" ,
37
- " .tox" ,
38
- " .venv" ,
39
- " .vscode" ,
40
- " __pypackages__" ,
41
- " _build" ,
42
- " buck-out" ,
43
- " build" ,
44
- " dist" ,
45
- " node_modules" ,
46
- " site-packages" ,
47
- " venv" ,
48
- " samples/proto" ,
49
- ]
50
-
51
- # Same as Black.
52
- line-length = 88
53
- indent-width = 4
18
+ # ## Ruff settings ###
54
19
55
- target-version = " py38"
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
-
64
- # Allow fix for all enabled rules (when `--fix`) is provided.
65
- fixable = [" ALL" ]
66
- unfixable = []
67
-
68
- # Allow unused variables when underscore-prefixed.
69
- dummy-variable-rgx = " ^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
20
+ # Top-level
21
+ [tool .ruff ]
22
+ target-version = " py39"
23
+ line-length = 120
24
+ extend-exclude = [" samples/proto" ]
70
25
26
+ # Format
71
27
[tool .ruff .format ]
72
- # Like Black, use double quotes for strings.
73
- quote-style = " double"
74
-
75
- # Like Black, indent with spaces, rather than tabs.
76
- indent-style = " space"
28
+ docstring-code-format = true
77
29
78
- # Like Black, respect magic trailing commas.
79
- skip-magic-trailing-comma = false
30
+ # Lint
31
+ [tool .ruff .lint ]
32
+ select = [
33
+ " E" , # pycodestyle errors
34
+ " W" , # pycodestyle warnings
35
+ " F" , # pyflakes
36
+ " I" , # Check for missing imports (auto-fixable)
37
+ " UP" , # pyupgrade
38
+ " ASYNC" , # flake8-async
39
+ " ISC" , # Checks for implicit literal string concatenation (auto-fixable)
40
+ " LOG" , # Checking the use of logging objects
41
+ " G" , # Check for logging format issues (auto-fixable)
42
+ ]
43
+ ignore = [
44
+ " ISC001" # may casue conflict with ruff
45
+ ]
80
46
81
- # Like Black, automatically detect the appropriate line ending.
82
- line-ending = " auto"
83
47
84
- # Enable auto-formatting of code examples in docstrings. Markdown,
85
- # reStructuredText code/literal blocks and doctests are all supported.
86
- docstring-code-format = true
48
+ [tool .ruff .lint .isort ]
49
+ combine-as-imports = true
87
50
88
- # Set the line length limit used when formatting code snippets in
89
- # docstrings.
90
- #
91
- # This only has an effect when the `docstring-code-format` setting is
92
- # enabled.
93
- docstring-code-line-length = " dynamic"
51
+ section-order = [
52
+ " future" ,
53
+ " standard-library" ,
54
+ " third-party" ,
55
+ " first-party" ,
56
+ " local-folder"
57
+ ]
94
58
95
59
96
- # # pytest settings ##
97
- [tool .pytest .ini_options ]
98
- addopts = [
99
- " -ra" ,
100
- " -p" , " no:warnings"
101
- ]
102
- testpaths = [" tests" ]
60
+ [tool .mypy ]
61
+ files = " src"
0 commit comments