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

[pycodestyle] Implement missing-or-outdented-indentation (E122) #11349

Open
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

augustelalande
Copy link
Contributor

@augustelalande augustelalande commented May 9, 2024

Summary

Following the discussion in #8557, and since no more work has been done since then, I thought I would take a stab at E122.

Part of #2402.

Test Plan

Test fixtures added.

I also validated the output against pycodestyle on some of the ecosystem repos.

Copy link

codspeed-hq bot commented May 9, 2024

CodSpeed Performance Report

Merging #11349 will not alter performance

Comparing augustelalande:E122 (00cc680) with main (46fcd19)

Summary

✅ 30 untouched benchmarks

Copy link
Contributor

github-actions bot commented May 9, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+13 -0 violations, +0 -0 fixes in 3 projects; 47 projects unchanged)

bokeh/bokeh (+8 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

+ src/bokeh/models/ui/ui_element.py:81:1: E122 Continuation line missing indentation or outdented.
+ src/bokeh/util/compiler.py:329:1: E122 Continuation line missing indentation or outdented.
+ src/bokeh/util/compiler.py:340:1: E122 Continuation line missing indentation or outdented.
+ src/bokeh/util/compiler.py:351:1: E122 Continuation line missing indentation or outdented.
+ src/bokeh/util/compiler.py:366:1: E122 Continuation line missing indentation or outdented.
+ src/bokeh/util/compiler.py:382:1: E122 Continuation line missing indentation or outdented.
+ src/bokeh/util/compiler.py:385:1: E122 Continuation line missing indentation or outdented.
+ tests/unit/bokeh/command/subcommands/test_serve.py:403:1: E122 Continuation line missing indentation or outdented.

milvus-io/pymilvus (+4 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ examples/example_tls1.py:70:1: E122 Continuation line missing indentation or outdented.
+ examples/example_tls1.py:71:1: E122 Continuation line missing indentation or outdented.
+ examples/example_tls2.py:72:1: E122 Continuation line missing indentation or outdented.
+ examples/example_tls2.py:73:1: E122 Continuation line missing indentation or outdented.

pandas-dev/pandas (+1 -0 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview

+ pandas/tests/extension/test_arrow.py:929:1: E122 Continuation line missing indentation or outdented.

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
E122 13 13 0 0 0

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@augustelalande augustelalande marked this pull request as draft May 9, 2024 02:33
@augustelalande augustelalande marked this pull request as ready for review May 19, 2024 06:48
@augustelalande
Copy link
Contributor Author

augustelalande commented May 19, 2024

@MichaReiser Could you review this when you get the chance? Thanks.

Note when reviewing: pycodestyle allows two types of indentation: hanging indent and visual indent. However, it does not enforce a single style. Which is to say that even if one style is violated, if the other is followed then no error is reported. Therefore even though this rule doesn't check for visual indentation, it still needs to establish if visual indentation is present in order to match the pycodestyle behavior.

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

Successfully merging this pull request may close these issues.

None yet

1 participant