You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Searching through closed and opened issues, I did not see anywhere that this is intentional or known, apologies if I missed something. It appears that in certain scenarios E231 is not triggering as expected, whereas in pycodestyle is it being caught. It may impact other scenarios, but the primary one I could find is it not working on dicts inside a list. Strangely enough it does work in tuples, and outside lists, just not in lists. Even stranger, only if not the first key/value; it does work if it is the first key/value in the dict in the list.
To note, if using ruff format, it would fix this, so not a blocker if you are also using format along with check. If you are only using ruff to replace pycodestyle without format (for whatever reason, such as your project not being ready/compatible with auto format), then you would hit this miss if only using ruff and not pycodestyle.
I know E231 is still preview, and this is a pretty minor miss, but I assume the goal is for parity with pycodestyle (and consistency across nested objects).
The text was updated successfully, but these errors were encountered:
…hen dict nested in list (#10469)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:
- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->
## Summary
Fix `E231` bug: Inconsistent catch compared to pycodestyle, such as when
dict nested in list. Resolves#10113.
## Test Plan
Example from #10113 added to test fixture.
Searching through closed and opened issues, I did not see anywhere that this is intentional or known, apologies if I missed something. It appears that in certain scenarios E231 is not triggering as expected, whereas in pycodestyle is it being caught. It may impact other scenarios, but the primary one I could find is it not working on dicts inside a list. Strangely enough it does work in tuples, and outside lists, just not in lists. Even stranger, only if not the first key/value; it does work if it is the first key/value in the dict in the list.
pyproject.toml
Python file
pycodestyle 2.11.1 catching all 4
ruff 0.2.2 catching 3/4
To note, if using ruff format, it would fix this, so not a blocker if you are also using format along with check. If you are only using ruff to replace pycodestyle without format (for whatever reason, such as your project not being ready/compatible with auto format), then you would hit this miss if only using ruff and not pycodestyle.
I know E231 is still preview, and this is a pretty minor miss, but I assume the goal is for parity with pycodestyle (and consistency across nested objects).
The text was updated successfully, but these errors were encountered: