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

E111 not being reported? #1527

Closed
MarcoGorelli opened this issue Jan 1, 2023 · 2 comments
Closed

E111 not being reported? #1527

MarcoGorelli opened this issue Jan 1, 2023 · 2 comments

Comments

@MarcoGorelli
Copy link

MarcoGorelli commented Jan 1, 2023

Hi,

I may be misunderstanding something, but from the README

By default, Ruff enables all E and F error codes, which correspond to those built-in to Flake8.

I thought that all E* codes from flake8 would show up with ruff too. But here I see E111 being skipped:

Example:

(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ cat t.py
if 2 + 5:
  pass
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ flake8 t.py
t.py:2:3: E111 indentation is not a multiple of 4
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ ruff t.py

Diagnostics:

(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ ruff --version
ruff 0.0.205
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ flake8 --version
6.0.0 (mccabe: 0.7.0, pycodestyle: 2.10.0, pyflakes: 3.0.1) CPython 3.8.16 on Linux
(.venv) marcogorelli@DESKTOP-U8OKFP3:~/tmp$ python --version
Python 3.8.16

Likewise for E226

@squiddy
Copy link
Contributor

squiddy commented Jan 1, 2023

Hey,

that refers to all error codes as currently implemented by ruff. E111 is not one of them. One is able to replace flake8 with ruff under conditions mentioned here.

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.

None of error codes < E400 from pycodestyle have been implemented so far. A more recent comment from Charlie on that matter:

We prioritized the rules based on the assumption that Ruff would be used alongside Black -- so we just haven't focused on implementing rules like E302 that are made obsolete by an autoformatter. (It doesn't mean we won't implement them, just that they weren't / haven't been prioritized.) That's one of the key assumptions baked into any "parity with Flake8" claims. I hope it doesn't come across as misleading, it's all documented in the FAQ, definitely not my intent.

Originally posted by @charliermarsh in #1073 (comment)

That said, eventually becoming an autoformatter is in scope of this project.

@MarcoGorelli
Copy link
Author

hey, that's clear, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants