Skip to content

Conversation

@RazerM
Copy link
Contributor

@RazerM RazerM commented Aug 10, 2025

Stacked on top of #19849; diff will include that PR until it is merged.


Summary

As part of #19849, I noticed this fix could be implemented.

Test Plan

Tests added based on CPython behaviour.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 10, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser
Copy link
Member

Could you rebase your PR now that #19849 is merged. It will make it easier for us to review your changes. Thank you

@RazerM RazerM force-pushed the feature/split-static-string-whitespace-maxsplit branch from f4fe4b9 to f971443 Compare August 11, 2025 11:14
Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Thanks, this makes sense to me!

If we wanted to be conservative we could probably gate this behind preview since it's conceptually close to adding a new safe fix to a stable rule. However, I think it's okay because the fact that the fix was missing before was kind of surprising. And there are no changes in the ecosystem either.

@ntBre ntBre added the fixes Related to suggested fixes for violations label Aug 12, 2025
@ntBre ntBre changed the title SIM905: Implement fix for maxsplit without separator [flake8-simplify] Implement fix for maxsplit without separator (SIM905) Aug 12, 2025
@ntBre
Copy link
Contributor

ntBre commented Aug 12, 2025

The more I think about this, the more I'm leaning towards using preview to be safe. @MichaReiser do you feel strongly one way or the other? I only found 99 results in a code search, so maybe it's quite a niche pattern anyway.

The preview-gate itself would be easy enough, but we also need a new function in preview.rs and to add the test case to the flake8-simplify preview_rules function, if we go that route.

@MichaReiser
Copy link
Member

I think we have to, according to our versioning policy. See #8074 why we might want to change that.

@ntBre
Copy link
Contributor

ntBre commented Aug 13, 2025

Sounds good, @RazerM do you mind gating this behind preview?

@ntBre ntBre added the preview Related to preview mode features label Aug 13, 2025
@RazerM
Copy link
Contributor Author

RazerM commented Aug 14, 2025

@ntBre I think I've done it correctly, but let me know.

Copy link
Contributor

@ntBre ntBre left a comment

Choose a reason for hiding this comment

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

Excellent, thank you!

@ntBre ntBre merged commit 2e1d662 into astral-sh:main Aug 15, 2025
35 checks passed
dcreager added a commit that referenced this pull request Aug 16, 2025
* main:
  [`isort`] Handle multiple continuation lines after module docstring (`I002`) (#19818)
  [`flake8-simplify`] Implement fix for `maxsplit` without separator (`SIM905`) (#19851)
  [`pycodestyle`] Make `E731` fix unsafe instead of display-only for class assignments (#19700)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixes Related to suggested fixes for violations preview Related to preview mode features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants