forked from zmievsa/cadwyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruff.toml
108 lines (102 loc) · 4.51 KB
/
ruff.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
target-version = "py310"
line-length = 120
extend-exclude = ["scripts/*.py"]
[lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"C90", # mccabe
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"S", # flake8-bandit
"BLE", # flake8-blind-except
"FBT003", # flake8-boolean-trap
"B", # flake8-bugbear
"COM", # flake8-commas
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"ISC", # flake8-implicit-str-concat
"G010", # Logging statement uses warn instead of warning
"G201", # Logging .exception(...) should be used instead of .error(..., exc_info=True)
"G202", # Logging statement has redundant exc_info
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"ERA", # flake8-eradicate
"LOG", # flake8-logging
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PLC0414", # Import alias does not rename original package
"PLE", # Error
"PLW", # Warning
"TRY", # tryceratops
"FLY", # flynt
"RUF", # ruff-specific rules
"ANN001", # missing type annotation for arguments
"ANN002", # missing type annotation for *args
"ANN003", # missing type annotation for **kwargs
]
unfixable = [
"ERA001", # eradicate: found commented out code (can be dangerous if fixed automatically)
]
ignore = [
"D203", # 1 blank line required before class docstring
"ARG001", # Unused first argument
"ARG002", # Unused method argument
"TRY003", # Avoid specifying long messages outside the exception class
"TRY300", # Consider moving statement into the else clause
"PT019", # Fixture without value is injected as parameter, use @pytest.mark.usefixtures instead
# (usefixtures doesn't play well with IDE features such as auto-renaming)
"SIM108", # Use ternary operator instead of if-else block (ternaries lie to coverage)
"RET505", # Unnecessary `else` after `return` statement
"N805", # First argument of a method should be named `self` (pydantic validators don't play well with this)
"UP007", # Use `X | Y` for type annotations (we need this for testing and our runtime logic)
# The following rules are recommended to be ignored by ruff when using ruff format
"ISC001", # Checks for implicitly concatenated strings on a single line
"ISC002", # Checks for implicitly concatenated strings that span multiple lines
"W191", # Checks for indentation that uses tabs
"E111", # Checks for indentation with a non-multiple of 4 spaces
"E114", # Checks for indentation of comments with a non-multiple of 4 spaces
"E117", # Checks for over-indented code
"D206", # Checks for docstrings that are indented with tabs
"D300", # Checks for docstrings that use '''single quotes''' instead of """double quotes"""
"Q000", # Checks for inline strings that use single quotes or double quotes
"Q001", # Checks for multiline strings that use single quotes or double quotes
"Q002", # Checks for docstrings that use single quotes or double quotes
"Q003", # Checks for strings that include escaped quotes
"COM812", # Checks for the absence of trailing commas
"COM819", # Checks for the presence of prohibited trailing commas
"RET506", # Unnecessary `elif` after `raise` statement
]
[lint.per-file-ignores]
"**/tests/*" = [
"S", # ignore bandit security issues in tests
"B018", # ignore useless expressions in tests
"PT012", # ignore complex with pytest.raises clauses
"RUF012", # ignore mutable class attributes ClassVar typehint requirement
"ANN001", # Missing type annotation for function argument
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"PGH003", # Use specific rule codes when ignoring type issues
"B008", # Do not perform function call in argument defaults
]
"cadwyn/_utils.py" = [
"ERA001", # Found commented-out code (it's not actually commented out. It's just comments)
]
[lint.mccabe]
max-complexity = 14
[format]
quote-style = "double"
indent-style = "space"