Skip to content

Commit 626b39f

Browse files
authored
Configure ruff by allowing all rules and then exclude some (#635)
1 parent c87c3d7 commit 626b39f

File tree

2 files changed

+14
-101
lines changed

2 files changed

+14
-101
lines changed

libs/knowledge-graph/pyproject.toml

Lines changed: 7 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -62,71 +62,28 @@ target-version = "py311"
6262

6363
[tool.ruff.lint]
6464
pydocstyle.convention = "google"
65+
select = ["ALL"]
6566
ignore = [
67+
"ANN", # Do we want to activate (type hints) ?
68+
"C90", # Do we want to activate (complexity) ?
6669
"COM812", # Messes with the formatter
6770
"D100", # Do we want to activate (docstring in module) ?
6871
"D104", # Do we want to activate (docstring in package) ?
6972
"D105", # Do we want to activate (docstring in magic method) ?
7073
"D107", # Do we want to activate (docstring in __init__) ?
74+
"EM", # Do we want to activate (error messages) ?
7175
"ERA", # Do we want to activate (no commented code) ?
76+
"FBT", # Do we want to activate (boolean trap) ?
77+
"FIX", # Do we want to activate (no fix-me) ?
7278
"ISC001", # Messes with the formatter
7379
"PERF203", # Incorrect detection
7480
"PLR09", # TODO: do we enforce these ones (complexity) ?
81+
"PTH", # Do we want to activate (use pathlib) ?
7582
"TRY003", # A bit too strict ?
7683
"TD002", # We know the TODOs authors with git. Activate anyway ?
7784
"TD003", # Do we want to activate (TODOs with issue reference) ?
7885
]
7986

80-
select = [
81-
"A",
82-
"ARG",
83-
"ASYNC",
84-
"B",
85-
"BLE",
86-
"C4",
87-
"COM",
88-
"D",
89-
"DTZ",
90-
"E",
91-
"EXE",
92-
"F",
93-
"FLY",
94-
"FURB",
95-
"G",
96-
"I",
97-
"ICN",
98-
"INP",
99-
"INT",
100-
"ISC",
101-
"LOG",
102-
"N",
103-
"NPY",
104-
"PD",
105-
"PERF",
106-
"PGH",
107-
"PIE",
108-
"PL",
109-
"PT",
110-
"PYI",
111-
"Q",
112-
"RET",
113-
"RSE",
114-
"RUF",
115-
"S",
116-
"SIM",
117-
"SLF",
118-
"SLOT",
119-
"T10",
120-
"T20",
121-
"TCH",
122-
"TD",
123-
"TID",
124-
"TRY",
125-
"UP",
126-
"W",
127-
"YTT",
128-
]
129-
13087
[tool.ruff.lint.per-file-ignores]
13188
"tests/*" = [
13289
"D",

pyproject.toml

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -59,72 +59,28 @@ extend-include = ["*.ipynb"]
5959

6060
[tool.ruff.lint]
6161
pydocstyle.convention = "google"
62+
select = ["ALL"]
6263
ignore = [
64+
"ANN", # Do we want to activate (type hints) ?
65+
"C90", # Do we want to activate (complexity) ?
6366
"COM812", # Messes with the formatter
6467
"D100", # Do we want to activate (docstring in module) ?
6568
"D104", # Do we want to activate (docstring in package) ?
6669
"D105", # Do we want to activate (docstring in magic method) ?
6770
"D107", # Do we want to activate (docstring in __init__) ?
71+
"EM", # Do we want to activate (error messages) ?
6872
"ERA", # Do we want to activate (no commented code) ?
73+
"FBT", # Do we want to activate (boolean trap) ?
74+
"FIX", # Do we want to activate (no fix-me) ?
6975
"ISC001", # Messes with the formatter
7076
"PERF203", # Incorrect detection
7177
"PLR09", # TODO: do we enforce these ones (complexity) ?
78+
"PTH", # Do we want to activate (use pathlib) ?
7279
"TRY003", # A bit too strict ?
7380
"TD002", # We know the TODOs authors with git. Activate anyway ?
7481
"TD003", # Do we want to activate (TODOs with issue reference) ?
7582
]
7683

77-
select = [
78-
"A",
79-
"ARG",
80-
"ASYNC",
81-
"B",
82-
"BLE",
83-
"C4",
84-
"COM",
85-
"D",
86-
"DTZ",
87-
"E",
88-
"EXE",
89-
"F",
90-
"FA",
91-
"FLY",
92-
"FURB",
93-
"G",
94-
"I",
95-
"ICN",
96-
"INP",
97-
"INT",
98-
"ISC",
99-
"LOG",
100-
"N",
101-
"NPY",
102-
"PD",
103-
"PERF",
104-
"PGH",
105-
"PIE",
106-
"PL",
107-
"PT",
108-
"PYI",
109-
"Q",
110-
"RET",
111-
"RSE",
112-
"RUF",
113-
"S",
114-
"SIM",
115-
"SLF",
116-
"SLOT",
117-
"T10",
118-
"T20",
119-
"TCH",
120-
"TD",
121-
"TID",
122-
"TRY",
123-
"UP",
124-
"W",
125-
"YTT",
126-
]
127-
12884
[tool.ruff.lint.per-file-ignores]
12985
"libs/langchain/*" = [
13086
"UP006", # Incompatible with Pydantic v1

0 commit comments

Comments
 (0)