Skip to content

Conversation

@diceroll123
Copy link
Contributor

@diceroll123 diceroll123 commented Aug 8, 2024

Summary

The dedent_to function has a difficult time with mixed whitespace.

The code now conditionally uses the LibCST method if there is mixed whitespace.

Fixes #12707

Test Plan

cargo test

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 8, 2024

CodSpeed Performance Report

Merging #12740 will not alter performance

Comparing diceroll123:fix-RET505-indent-errors (d922997) with main (df7345e)

Summary

✅ 32 untouched benchmarks

@diceroll123 diceroll123 force-pushed the fix-RET505-indent-errors branch from 5b03a5d to d165c3e Compare August 8, 2024 06:33
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser
Copy link
Member

This seems like a pretty big regression. I think I would prefer just to disable the fix in case there's mixed-indentation than regressing performance by that much.

@diceroll123
Copy link
Contributor Author

Yeah, that is not ideal as is.

I'd like to try one more alternative approach, which does already include detecting mixed indentation.

@diceroll123 diceroll123 changed the title [ruff_linter] - Remove dedent_to usage from adjust_indentation helper [ruff_linter] - Use LibCST in adjust_indentation for mixed whitespace Aug 8, 2024
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Nice!

@diceroll123 diceroll123 force-pushed the fix-RET505-indent-errors branch from f9db08e to d922997 Compare August 8, 2024 08:43
@MichaReiser MichaReiser added bug Something isn't working preview Related to preview mode features labels Aug 8, 2024
@MichaReiser MichaReiser merged commit 6d9205e into astral-sh:main Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working preview Related to preview mode features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RET505 doesn't work with mixed space and tabs

2 participants