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

Fix trailing kwargs end of line comment after slash #10297

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

MichaReiser
Copy link
Member

Summary

Fixes the handling end of line comments that belong to **kwargs when the **kwargs come after a slash.

The issue was that we missed to include the **kwargs start position when determining the start of the next node coming after the /.

Fixes #10281

Test Plan

Added test

@MichaReiser MichaReiser added bug Something isn't working formatter Related to the formatter labels Mar 8, 2024
@MichaReiser MichaReiser requested a review from konstin March 8, 2024 13:04
Copy link
Contributor

github-actions bot commented Mar 8, 2024

ruff-ecosystem results

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@MichaReiser MichaReiser force-pushed the fix-trailing-kwargs-comment-after-slash branch from 2a1c883 to ebb2177 Compare March 8, 2024 14:38
@MichaReiser MichaReiser enabled auto-merge (squash) March 8, 2024 14:38
@MichaReiser MichaReiser merged commit 965adbe into main Mar 8, 2024
17 checks passed
@MichaReiser MichaReiser deleted the fix-trailing-kwargs-comment-after-slash branch March 8, 2024 14:45
nkxxll pushed a commit to nkxxll/ruff that referenced this pull request Mar 10, 2024
## Summary

Fixes the handling end of line comments that belong to `**kwargs` when
the `**kwargs` come after a slash.

The issue was that we missed to include the `**kwargs` start position
when determining the start of the next node coming after the `/`.

Fixes astral-sh#10281

## Test Plan

Added test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter Related to the formatter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ruff format moves # noqa comment to wrong location
2 participants