Skip to content

[syntax-errors] Use consistent message for bad starred expression usage. #17772

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

abhijeetbodas2001
Copy link
Contributor

Summary

Follow up from #17624, where we found that the error message sent by SemanticSyntaxErrorKind and ParseErrorType were different for invalid *expr usage.
This PR changes the message of SemanticSyntaxErrorKind::InvalidStarExpression to be the same as the error message of the parser.

Ref: #17624 (comment)

Test Plan

Updated existing tests.

@abhijeetbodas2001
Copy link
Contributor Author

cc @ntBre

Copy link
Contributor

github-actions bot commented May 1, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

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.

Awesome, thanks for following up! I believe this is exactly what @dhruvmanila suggested, but I'll wait to merge until he has a chance to look.

Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @ntBre for checking in!

@MichaReiser MichaReiser merged commit 0c80c56 into astral-sh:main May 1, 2025
34 checks passed
@abhijeetbodas2001 abhijeetbodas2001 deleted the syntax-error branch May 1, 2025 18:30
dcreager added a commit that referenced this pull request May 2, 2025
* main:
  [red-knot] Refactor: no mutability in call APIs (#17788)
  [red-knot] Fix panic for `tuple[x[y]]` string annotation (#17787)
  [red-knot] Implicit instance attributes in generic methods (#17769)
  doc: Add link to `check-typed-exception` from `S110` and `S112` (#17786)
  Fix module name in ASYNC110, 115, and 116 fixes (#17774)
  [red-knot] More informative hover-types for assignments (#17762)
  [syntax-errors] Use consistent message for bad starred expression usage. (#17772)
  red_knot_server: add auto-completion MVP
  Allow passing a virtual environment to `ruff analyze graph` (#17743)
  Bump 0.11.8 (#17766)
  [`flake8-use-pathlib`] Fix `PTH104`false positive when `rename` is passed a file descriptor (#17712)
ntBre added a commit to maxmynter/ruff that referenced this pull request May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants