Update pylint config docs (#2931)
This commit is contained in:
parent
086ae68076
commit
fa7f01592b
@ -32,6 +32,8 @@
|
|||||||
<!-- Major changes to documentation and policies. Small docs changes
|
<!-- Major changes to documentation and policies. Small docs changes
|
||||||
don't need a changelog entry. -->
|
don't need a changelog entry. -->
|
||||||
|
|
||||||
|
- Update pylint config documentation (#2931)
|
||||||
|
|
||||||
### Integrations
|
### Integrations
|
||||||
|
|
||||||
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
|
||||||
|
@ -1,5 +1,2 @@
|
|||||||
[MESSAGES CONTROL]
|
|
||||||
disable = C0330, C0326
|
|
||||||
|
|
||||||
[format]
|
[format]
|
||||||
max-line-length = 88
|
max-line-length = 88
|
||||||
|
@ -1,5 +1,2 @@
|
|||||||
[tool.pylint.messages_control]
|
|
||||||
disable = "C0330, C0326"
|
|
||||||
|
|
||||||
[tool.pylint.format]
|
[tool.pylint.format]
|
||||||
max-line-length = "88"
|
max-line-length = "88"
|
||||||
|
@ -1,5 +1,2 @@
|
|||||||
[pylint]
|
[pylint]
|
||||||
max-line-length = 88
|
max-line-length = 88
|
||||||
|
|
||||||
[pylint.messages_control]
|
|
||||||
disable = C0330, C0326
|
|
||||||
|
@ -210,31 +210,16 @@ mixed feelings about _Black_'s formatting style.
|
|||||||
#### Configuration
|
#### Configuration
|
||||||
|
|
||||||
```
|
```
|
||||||
disable = C0326, C0330
|
|
||||||
max-line-length = 88
|
max-line-length = 88
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Why those options above?
|
#### Why those options above?
|
||||||
|
|
||||||
When _Black_ is folding very long expressions, the closing brackets will
|
Pylint should be configured to only complain about lines that surpass `88` characters
|
||||||
[be dedented](../the_black_code_style/current_style.md#how-black-wraps-lines).
|
via `max-line-length = 88`.
|
||||||
|
|
||||||
```py3
|
If using `pylint<2.6.0`, also disable `C0326` and `C0330` as these are incompatible with
|
||||||
ImportantClass.important_method(
|
_Black_ formatting and have since been removed.
|
||||||
exc, limit, lookup_lines, capture_locals, callback
|
|
||||||
)
|
|
||||||
```
|
|
||||||
|
|
||||||
Although this style is PEP 8 compliant, Pylint will raise
|
|
||||||
`C0330: Wrong hanging indentation before block (add 4 spaces)` warnings. Since _Black_
|
|
||||||
isn't configurable on this style, Pylint should be told to ignore these warnings via
|
|
||||||
`disable = C0330`.
|
|
||||||
|
|
||||||
Also, since _Black_ deals with whitespace around operators and brackets, Pylint's
|
|
||||||
warning `C0326: Bad whitespace` should be disabled using `disable = C0326`.
|
|
||||||
|
|
||||||
And as usual, Pylint should be configured to only complain about lines that surpass `88`
|
|
||||||
characters via `max-line-length = 88`.
|
|
||||||
|
|
||||||
#### Formats
|
#### Formats
|
||||||
|
|
||||||
@ -242,9 +227,6 @@ characters via `max-line-length = 88`.
|
|||||||
<summary>pylintrc</summary>
|
<summary>pylintrc</summary>
|
||||||
|
|
||||||
```ini
|
```ini
|
||||||
[MESSAGES CONTROL]
|
|
||||||
disable = C0326, C0330
|
|
||||||
|
|
||||||
[format]
|
[format]
|
||||||
max-line-length = 88
|
max-line-length = 88
|
||||||
```
|
```
|
||||||
@ -257,9 +239,6 @@ max-line-length = 88
|
|||||||
```cfg
|
```cfg
|
||||||
[pylint]
|
[pylint]
|
||||||
max-line-length = 88
|
max-line-length = 88
|
||||||
|
|
||||||
[pylint.messages_control]
|
|
||||||
disable = C0326, C0330
|
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
@ -268,9 +247,6 @@ disable = C0326, C0330
|
|||||||
<summary>pyproject.toml</summary>
|
<summary>pyproject.toml</summary>
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
[tool.pylint.messages_control]
|
|
||||||
disable = "C0326, C0330"
|
|
||||||
|
|
||||||
[tool.pylint.format]
|
[tool.pylint.format]
|
||||||
max-line-length = "88"
|
max-line-length = "88"
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user