Skip to content

Conversation

@danparizher
Copy link
Contributor

Summary

Fixes #20060

@github-actions
Copy link
Contributor

github-actions bot commented Aug 25, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I think it needs a few tweaks

@ntBre ntBre added bug Something isn't working rule Implementing or modifying a lint rule labels Aug 25, 2025
@dscorbett
Copy link

I recommend making FAST003 only apply to parameters as recognized by FastAPI, instead of just checking for leading and trailing ASCII spaces.

@dylwil3
Copy link
Collaborator

dylwil3 commented Aug 25, 2025

I recommend making FAST003 only apply to parameters as recognized by FastAPI, instead of just checking for leading and trailing ASCII spaces.

I think if we avoid the trim then this is basically true (modulo reserved keywords) since we check whether we have an identifier (as pointed out above). So I don't think we need to port the regex over.

@dscorbett
Copy link

I don’t think it is true, even ignoring keywords, but I can open another issue later since it’s not directly related to this one.

@danparizher danparizher requested a review from dylwil3 August 25, 2025 16:49
Comment on lines 491 to 494
if param_name.starts_with(' ') || param_name.ends_with(' ') {
continue;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we forgot to remove this part

@danparizher danparizher requested a review from dylwil3 August 26, 2025 23:11
Copy link
Collaborator

@dylwil3 dylwil3 left a comment

Choose a reason for hiding this comment

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

Thank you!

@dylwil3 dylwil3 enabled auto-merge (squash) August 29, 2025 13:38
@dylwil3 dylwil3 merged commit 0ff0c70 into astral-sh:main Aug 29, 2025
34 checks passed
@danparizher danparizher deleted the fix-20060 branch August 29, 2025 14:30
second-ed pushed a commit to second-ed/ruff that referenced this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FAST003 false positive for parameters with spaces like /{ x }

4 participants