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

Update D208 to preserve indentation offsets when fixing overindented lines #8699

Merged
merged 3 commits into from
Nov 17, 2023

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Nov 15, 2023

Closes #8695

We track the smallest offset seen for overindented lines then only reduce the indentation of the lines that far to preserve indentation in other lines. This rule's behavior now matches our formatter, which is nice.

We may want to gate this with preview.

@zanieb zanieb added the rule Implementing or modifying a lint rule label Nov 15, 2023
@zanieb zanieb added the docstring Related to docstring linting or formatting label Nov 15, 2023
Copy link
Contributor

github-actions bot commented Nov 15, 2023

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@zanieb zanieb marked this pull request as ready for review November 16, 2023 20:00
Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@zanieb
Copy link
Member Author

zanieb commented Nov 17, 2023

@charliermarsh any thoughts on preview? It seems like best practice?

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding correctly that this only affects the fix, I would be fine shipping this to stable.

@charliermarsh
Copy link
Member

(But defer to you as the author.)

@zanieb zanieb merged commit bd99175 into main Nov 17, 2023
17 checks passed
@zanieb zanieb deleted the zanie/fix-d208 branch November 17, 2023 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docstring Related to docstring linting or formatting rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

D208 should outdent whole blocks and not line-byline
3 participants