Skip to content

[syntax-errors] Make duplicate parameter names a semantic error #17131

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 2 commits into from
Apr 23, 2025

Conversation

ntBre
Copy link
Contributor

@ntBre ntBre commented Apr 1, 2025

Status

This is a pretty minor change, but it was breaking a red-knot mdtest until #17463 landed. Now this should close #11934 as the last syntax error being tracked there!

Summary

Moves Parser::validate_parameters to SemanticSyntaxChecker::duplicate_parameter_name.

Test Plan

Existing tests, with ## Errors replaced with ## Semantic Syntax Errors.

@ntBre ntBre added rule Implementing or modifying a lint rule preview Related to preview mode features labels Apr 1, 2025
@ntBre ntBre force-pushed the brent/syn-duplicate-parameter-names branch from ddbea3e to 03586e0 Compare April 23, 2025 14:04
Summary
--

Moves `Parser::validate_parameters` to
`SemanticSyntaxChecker::duplicate_parameter_name`.

Test Plan
--

Existing tests, with `## Errors` replaced with `## Semantic Syntax Errors` and
an additional case for `lambda` expressions.
@ntBre ntBre force-pushed the brent/syn-duplicate-parameter-names branch from 03586e0 to 8a57f1d Compare April 23, 2025 14:06
Copy link
Contributor

github-actions bot commented Apr 23, 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.

@ntBre ntBre marked this pull request as ready for review April 23, 2025 14:20
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.

Congrats on finishing all the syntax errors!

@ntBre ntBre merged commit d5410ef into main Apr 23, 2025
33 checks passed
@ntBre ntBre deleted the brent/syn-duplicate-parameter-names branch April 23, 2025 19:45
dcreager added a commit that referenced this pull request Apr 24, 2025
* main:
  [red-knot] fix collapsing literal and its negation to object (#17605)
  [red-knot] Add more tests for protocols (#17603)
  [red-knot] Ban direct instantiations of `Protocol` classes (#17597)
  [`pyupgrade`] Preserve parenthesis when fixing native literals containing newlines (`UP018`) (#17220)
  [`airflow`] fix typos (`AIR302`, `AIR312`) (#17574)
  [red-knot] Special case `@abstractmethod` for function type (#17591)
  [red-knot] Emit diagnostics for isinstance() and issubclass() calls where a non-runtime-checkable protocol is the second argument (#17561)
  [red-knot] Infer the members of a protocol class (#17556)
  [red-knot] Add `FunctionType::to_overloaded` (#17585)
  [red-knot] Add mdtests for `global` statement (#17563)
  [syntax-errors] Make duplicate parameter names a semantic error (#17131)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

☂️ Syntax errors raised by the compiler
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy