-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathruff-ci.toml
More file actions
127 lines (120 loc) · 2.88 KB
/
ruff-ci.toml
File metadata and controls
127 lines (120 loc) · 2.88 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
118
119
120
121
122
123
124
125
126
127
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
target-version = "py310"
line-length = 100
[lint]
preview = true
explicit-preview-rules = true
select = ["ALL"]
extend-select = ["W391", "E303"]
allowed-confusables = ["−"]
ignore = [
# Disabled permanently
"D203", # Blank line after class def (we do not use this style)
"D213", # Multi-line summary second line (we do not use this style)
"COM812", # Missing trailing comma (unnecessary with auto format)
"FIX", # FIX related rules
"TD", # TODO related rules
"S603", # Start process without shell
"S607", # Start process with partial path
"TRY003", # Custom exception with vanilla args. This is reasonable if the
# exception is used as a sentinel.
"EM101", # String literals in exception
# High priority fixes
"B008", # function calls in default arg value
"PERF203", # Exception handling in loops
# Some noqas might be needed for compliance with full Ruff configuration,
# but not with the temporary ignores listed below in the CI configuration.
# To stop CI telling us we need to remove these noqas, temporarily disable
# the rule enforcing this in CI.
"RUF100",
# Temporary ignores just for CI until the rules pass then they can be removed
# from here to prevent future regressions
"ANN001",
"ANN201",
"ANN202",
"ANN204",
"ANN205",
"ARG001",
"ARG002",
"ARG004",
"B904",
"BLE001",
"C901",
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"D205",
"D400",
"D401",
"D404",
"D415",
"DTZ003",
"DTZ005",
"DTZ006",
"DTZ007",
"E501",
"ERA001",
"FBT001",
"FBT002",
"FBT003",
"FIX002",
"FURB122",
"G001",
"G003",
"G004",
"ISC001",
"LOG015",
"N801",
"PLC0414",
"PLC0415",
"PLR091",
"PLR2004",
"PLW0602",
"PLW0603",
"PLW0604",
"PLW2901",
"PT009",
"PT011",
"PTH103",
"PTH116",
"PTH118",
"PTH123",
"PYI024",
"RUF001",
"RUF012",
"S101",
"S103",
"S202",
"S311",
"S605",
"SIM115",
"SLF001",
"SLOT002",
"T201",
"TD002",
"TD003",
"TD004",
"TD005",
"TRY004",
"TRY300",
"TRY301",
"TRY401",
"UP031",
]
[lint.per-file-ignores]
# Less strict in the tests
"tests/**.py" = [
# Checks for boolean passed as positional argument which is useful in the
# main codebase for clarity. However it's common to assert against a boolean
# in tests and having to use kwargs in all cases will clutter the tests.
"FBT003",
# Configurable helper functions are common in test files and it is overbearing
# to restrict the number of arguments per function definition.
"PLR0913",
]