-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathruff.toml
More file actions
117 lines (111 loc) · 4.31 KB
/
ruff.toml
File metadata and controls
117 lines (111 loc) · 4.31 KB
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
109
110
111
112
113
114
115
116
117
target-version = "py312"
line-length = 120
exclude = [
".semgrep",
]
[lint]
select = [
"ALL",
# "A", # prevent using keywords that clobber python builtins
# "ANN", # flake8 annotations
# "B", # bugbear: security warnings
# "BLE", # blind exceptions
# "C4", # flake8-comprehensions
# "C90", # McCabe complexity
# "COM", # flake8-commas
# "D", # pydocstyle
# "DJ", # flake8-django
# "E", # pycodestylex
# "E4", "E7", "E9",
# "ERA", # eradicate
# "F", # pyflakes
# "FLY", # flynt
# "FURB", # refurb
# "I", # isort
# "ICN", # flake8-import-conventions
# "ISC", # implicit string concatenation
# "N", # Pep* naming
# "PERF", # perflint
# "PIE", # flake8-pie
# "PL", # PyLint
# "PT", # flake8-pytest-style
# "Q", # flake8-quotes
# "R", # PyLint Refactor
# "RET", # flake8-return
# "S", # bandit,
# "SIM", # flake8-simplify
# "T10", # flake8-debugger
# "T20", # flake8-print
# "TC", # flake8-type-checking
# "UP", # pyupgrade
# "W", # pycodestyle warnings
# "YTT", # flake8 2020
]
extend-select = ["UP", ]
ignore = [
"A005", # Module `???` shadows a Python standard-library module
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"ARG005", # Unused lambda argument:
"ANN401",
"B904", # raise-without-from-inside-except: syntax not compatible with py2
"COM812",
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D203", # one-blank-line-before-class
"D212", # multi-line-summary-first-line
"D213", # multi-line-summary-second-line
"DJ001", # Avoid using `null=True` on string-based fields such as `CharField`
"E731", # lambda-assignment: lambdas are substential in maintenance of py2/3 codebase
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # Boolean positional value in function call
"FIX002", # Line contains TODO, consider resolving the issue
"I001", # unsorted imports https://docs.astral.sh/ruff/rules/unsorted-imports/#unsorted-imports-i001
"ISC001", # conflicts with ruff format command
"PLR2004", # Magic value used in comparison
"PLC0415", # import top
"RUF005", # collection-literal-concatenation: syntax not compatible with py2
"RUF012", # mutable-class-default: typing is not available for py2
"SIM108", # Use ternary operator instead of...
"SLF001", # Private member accessed:
"TD003", # Missing issue link for this TODO
"TID252", # Prefer absolute imports over relative imports from parent modules
"TRY400", # Use logging.exception instead of logging.error in exception handlers
"TRY401", # Redundant exception object included in `logging.exception` call
"TRY003", # Avoid specifying long messages outside the exception class
"UP031", # Use format specifiers instead of percent format
"UP035", # Import from `collections.abc` instead: `Sequence`
"UP037", # [*] Remove quotes from type annotation
]
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[lint.isort]
case-sensitive = true
force-wrap-aliases = true
combine-as-imports = true
extra-standard-library = ["path"]
known-third-party = ['django']
known-first-party = ['country_workspace']
no-sections = false
lines-after-imports = 1
relative-imports-order = "furthest-to-closest"
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder", ]
[lint.per-file-ignores]
".semgrep/**/*.py" = ["ALL"]
"docs/**.py" = ["TC002", "U"]
"tests/**.py" = ["S101", "PGH004", "TRY002", "TRY", "PYI024", "PD901", "INP001", "PLR2004", "S", "SIM117", "D", "UP", "PLR0913", "ANN", "N999"]
"src/country_workspace/version.py" = ["ALL", ]
"src/**/migrations/**.py" = ["E501", ]
"src/**/versioning/**.py" = ["N999", ]