mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 18:58:04 +00:00
faq: Clarify how Ruff and Black treat line-length. (#4180)
This commit is contained in:
parent
b14358fbfe
commit
ccfc78e2d5
1 changed files with 6 additions and 0 deletions
|
@ -8,6 +8,12 @@ the `line-length` setting is consistent between the two.
|
|||
As a project, Ruff is designed to be used alongside Black and, as such, will defer implementing
|
||||
stylistic lint rules that are obviated by autoformatting.
|
||||
|
||||
Note that Ruff and Black treat line-length enforcement a little differently. Black makes a
|
||||
best-effort attempt to adhere to the `line-length`, but avoids automatic line-wrapping in some cases
|
||||
(e.g., within comments). Ruff, on the other hand, will flag rule `E501` for any line that exceeds
|
||||
the `line-length` setting. As such, if `E501` is enabled, Ruff can still trigger line-length
|
||||
violations even when Black is enabled.
|
||||
|
||||
## How does Ruff compare to Flake8?
|
||||
|
||||
(Coming from Flake8? Try [`flake8-to-ruff`](https://pypi.org/project/flake8-to-ruff/) to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue