|
2 | 2 | # Example usage: global configuration for PEP8 (via flake8) setting or default pytest arguments |
3 | 3 | # Local usage: pip install pre-commit, pre-commit run --all-files |
4 | 4 |
|
5 | | -[isort] |
6 | | -# https://pycqa.github.io/isort/docs/configuration/options.html |
7 | | -line_length = 100 |
8 | | -# see: https://pycqa.github.io/isort/docs/configuration/multi_line_output_modes.html |
9 | | -multi_line_output = 0 |
10 | | -include_trailing_comma = True |
11 | | - |
12 | | -[flake8] |
13 | | -# https://flake8.pycqa.org/en/latest/user/options.html |
14 | | -max-line-length = 100 |
15 | | -max-complexity = 20 |
16 | | -verbose = 2 |
17 | | -format = pylint |
18 | | -# https://pep8.readthedocs.io/en/latest/intro.html#error-codes |
19 | | -# see: https://www.flake8rules.com/ |
20 | | -select = B, C, E, F, W |
21 | | -ignore = C101, C407, C408, E402, E731, E741, W503 |
22 | | - # C101: Coding magic comment not found |
23 | | - # C407: Unnecessary <dict/list> comprehension - <builtin> can take a generator |
24 | | - # C408: Unnecessary <dict/list/tuple> call - rewrite as a literal |
25 | | - # E402: module level import not at top of file |
| 5 | +[ruff] |
| 6 | +# https://docs.astral.sh/ruff/configuration/ |
| 7 | +line-length = 100 |
| 8 | +indent-width = 4 |
| 9 | +# see: https://docs.astral.sh/ruff/rules |
| 10 | +select = |
| 11 | + F # Pyflakes |
| 12 | + E # Pycodestyle |
| 13 | + W # Pycodestyle |
| 14 | + C90 # McCabe |
| 15 | + I # Isort |
| 16 | + UP # PyUpgrade |
| 17 | + B # Flake8-bugbear |
| 18 | + C4 # Flake8-comprehensions |
| 19 | +ignore = C407, C408, E402, E731, E741, W503 |
| 20 | + # E402: Module level import not at top of file |
26 | 21 | # E731: Do not assign a lambda expression, use a def |
27 | 22 | # E741: Do not use variables named 'I', 'O', or 'l' |
28 | | - # W503: Line break occurred before a binary operator |
| 23 | + # W503: Line break occurred before a binary operator |
| 24 | + # C408: Unnecessary <dict/list/tuple> call - rewrite as a literal |
| 25 | +fixable = ["ALL"] |
| 26 | +unfixable = ["F401"] |
| 27 | + # F401: module imported but unused |
| 28 | +[ruff.lint] |
29 | 29 | per-file-ignores = |
30 | | - **/__init__.py: E402, F401, F403, F405 |
31 | | - # E402: module level import not at top of file |
32 | | - # F401: module imported but unused |
33 | | - # F403: βfrom module import *β used; unable to detect undefined names |
34 | | - # F405: Name may be undefined, or defined from star imports: module |
| 30 | + **/__init__.py: E402, F401, F403, F405 |
| 31 | + # E402: Module level import not at top of file |
| 32 | + # F401: Module imported but unused |
| 33 | + # F403: βfrom module import *β used; unable to detect undefined names |
| 34 | + # F405: Name may be undefined, or defined from star imports: module |
| 35 | +[ruff.format] |
| 36 | +quote-style = "single" |
| 37 | +indent-style = "tab" |
| 38 | +skip-magic-trailing-comma = false |
| 39 | +line-ending = "auto" |
| 40 | + |
| 41 | +# [isort] |
| 42 | +# # https://pycqa.github.io/isort/docs/configuration/options.html |
| 43 | +# line_length = 100 |
| 44 | +# # see: https://pycqa.github.io/isort/docs/configuration/multi_line_output_modes.html |
| 45 | +# multi_line_output = 0 |
| 46 | +# include_trailing_comma = True |
| 47 | + |
| 48 | +# [flake8] |
| 49 | +# # https://flake8.pycqa.org/en/latest/user/options.html |
| 50 | +# max-line-length = 100 |
| 51 | +# max-complexity = 20 |
| 52 | +# verbose = 2 |
| 53 | +# format = pylint |
| 54 | +# # https://pep8.readthedocs.io/en/latest/intro.html#error-codes |
| 55 | +# # see: https://www.flake8rules.com/ |
| 56 | +# select = B, C, E, F, W |
| 57 | +# ignore = C101, C407, C408, E402, E731, E741, W503 |
| 58 | +# # C101: Coding magic comment not found |
| 59 | +# # C407: Unnecessary <dict/list> comprehension - <builtin> can take a generator |
| 60 | +# # C408: Unnecessary <dict/list/tuple> call - rewrite as a literal |
| 61 | +# # E402: Module level import not at top of file |
| 62 | +# # E731: Do not assign a lambda expression, use a def |
| 63 | +# # E741: Do not use variables named 'I', 'O', or 'l' |
| 64 | +# # W503: Line break occurred before a binary operator |
| 65 | +# per-file-ignores = |
| 66 | + # **/__init__.py: E402, F401, F403, F405 |
| 67 | + # # E402: Module level import not at top of file |
| 68 | + # # F401: Module imported but unused |
| 69 | + # # F403: βfrom module import *β used; unable to detect undefined names |
| 70 | + # # F405: Name may be undefined, or defined from star imports: module |
0 commit comments