Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to recognize too many blank lines #1076

Closed
facundobatista opened this issue Dec 5, 2022 · 5 comments
Closed

Failure to recognize too many blank lines #1076

facundobatista opened this issue Dec 5, 2022 · 5 comments
Labels
rule Implementing or modifying a lint rule

Comments

@facundobatista
Copy link

Check the following code:

a = 100



b = 100

Flake8 will report E303 too many blank lines (3) but ruff passes silently.

$ fades -d flake8 -x flake8 --version
6.0.0 (mccabe: 0.7.0, pycodestyle: 2.10.0, pyflakes: 3.0.1) CPython 3.10.6 on Linux
$ fades -d flake8 -x flake8 x.py 
x.py:5:1: E303 too many blank lines (3)
$
$ fades -d ruff -x ruff --version
ruff 0.0.138
$ fades -d ruff -x ruff x.py 
$ 
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Dec 5, 2022
@charliermarsh
Copy link
Member

We don't support E303 right now, so this is expected.

@facundobatista
Copy link
Author

Will you support it in the future? Thanks!

@facundobatista
Copy link
Author

The README says

"""
Ruff can be used as a drop-in replacement for Flake8 when used (1) without or with a small number of plugins, (2) alongside Black, and (3) on Python 3 code.

Under those conditions, Ruff implements every rule in Flake8, with the exception of F811.
"""

Are there other missing codes in comparison to flake8? Thanks!

@charliermarsh
Copy link
Member

I might! The thing with E303 and other rules is that, IIUC, if you run Black over your code, it's effectively impossible to trigger them. Given Black's popularity, I intentionally deprioritized stylistic rules that are already fixed by Black. Eventually, I'd like to extend Ruff to do autoformatting which would effectively include automatically fixing those lint errors.

@charliermarsh
Copy link
Member

Closing in favor of #1073.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

2 participants