Skip to content

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
@github-actions
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

4 participants