Skip to content

Commit fa7f015

Browse files
authored
Update pylint config docs (#2931)
1 parent 086ae68 commit fa7f015

File tree

5 files changed

+6
-37
lines changed

5 files changed

+6
-37
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
<!-- Major changes to documentation and policies. Small docs changes
3333
don't need a changelog entry. -->
3434

35+
- Update pylint config documentation (#2931)
36+
3537
### Integrations
3638

3739
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
[MESSAGES CONTROL]
2-
disable = C0330, C0326
3-
41
[format]
52
max-line-length = 88
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
[tool.pylint.messages_control]
2-
disable = "C0330, C0326"
3-
41
[tool.pylint.format]
52
max-line-length = "88"
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
[pylint]
22
max-line-length = 88
3-
4-
[pylint.messages_control]
5-
disable = C0330, C0326

docs/guides/using_black_with_other_tools.md

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -210,41 +210,23 @@ mixed feelings about _Black_'s formatting style.
210210
#### Configuration
211211

212212
```
213-
disable = C0326, C0330
214213
max-line-length = 88
215214
```
216215

217216
#### Why those options above?
218217

219-
When _Black_ is folding very long expressions, the closing brackets will
220-
[be dedented](../the_black_code_style/current_style.md#how-black-wraps-lines).
218+
Pylint should be configured to only complain about lines that surpass `88` characters
219+
via `max-line-length = 88`.
221220

222-
```py3
223-
ImportantClass.important_method(
224-
exc, limit, lookup_lines, capture_locals, callback
225-
)
226-
```
227-
228-
Although this style is PEP 8 compliant, Pylint will raise
229-
`C0330: Wrong hanging indentation before block (add 4 spaces)` warnings. Since _Black_
230-
isn't configurable on this style, Pylint should be told to ignore these warnings via
231-
`disable = C0330`.
232-
233-
Also, since _Black_ deals with whitespace around operators and brackets, Pylint's
234-
warning `C0326: Bad whitespace` should be disabled using `disable = C0326`.
235-
236-
And as usual, Pylint should be configured to only complain about lines that surpass `88`
237-
characters via `max-line-length = 88`.
221+
If using `pylint<2.6.0`, also disable `C0326` and `C0330` as these are incompatible with
222+
_Black_ formatting and have since been removed.
238223

239224
#### Formats
240225

241226
<details>
242227
<summary>pylintrc</summary>
243228

244229
```ini
245-
[MESSAGES CONTROL]
246-
disable = C0326, C0330
247-
248230
[format]
249231
max-line-length = 88
250232
```
@@ -257,9 +239,6 @@ max-line-length = 88
257239
```cfg
258240
[pylint]
259241
max-line-length = 88
260-
261-
[pylint.messages_control]
262-
disable = C0326, C0330
263242
```
264243

265244
</details>
@@ -268,9 +247,6 @@ disable = C0326, C0330
268247
<summary>pyproject.toml</summary>
269248

270249
```toml
271-
[tool.pylint.messages_control]
272-
disable = "C0326, C0330"
273-
274250
[tool.pylint.format]
275251
max-line-length = "88"
276252
```

0 commit comments

Comments
 (0)