Skip to content

Conversation

@maxmynter
Copy link
Contributor

@maxmynter maxmynter commented Apr 29, 2025

Re: #17526

Summary

Adds tests to red knot and linter.rs for the semantic syntax.

Specifically add tests for ReboundComprehensionVariable, DuplicateTypeParameter, and MultipleCaseAssignment.

Refactor the test_async_comprehension_in_sync_comprehensiontest_semantic_error to be more general for all semantic syntax test cases.

Test Plan

This is a test.

Question

I'm happy to contribute more tests the coming days.

Should that happen here or should we merge this PR such that the refactor test_async_comprehension_in_sync_comprehensiontest_semantic_error is available on main and others can chime in, too?

for ReboundComprehensionVariable, MultipleCaseAssignments, and DuplicateTypeParameter
for ReboundComprehensionVariable, MultipleCaseAssignments, and DuplicateTypeParameter
@AlexWaygood AlexWaygood requested review from ntBre and removed request for AlexWaygood April 29, 2025 22:52
@AlexWaygood AlexWaygood added the testing Related to testing Ruff itself label Apr 29, 2025
@github-actions
Copy link
Contributor

mypy_primer results

No ecosystem changes detected ✅

@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

The red-knot tests here look good to me!

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.

This looks great, thank you!

Should that happen here or should we merge this PR such that the refactor test_async_comprehension_in_sync_comprehension → test_semantic_error is available on main and others can chime in, too?

I'll go ahead and merge this, and we can handle others in additional PRs. I think it makes sense to batch a few of them like you did here, though, instead of necessarily one PR per error, at least if the tests are pretty straightforward.

@ntBre ntBre merged commit f584b66 into astral-sh:main Apr 30, 2025
35 checks passed
dcreager added a commit that referenced this pull request May 1, 2025
* main:
  [red-knot] Preliminary `NamedTuple` support (#17738)
  [red-knot] Add tests for classes that have incompatible `__new__` and `__init__` methods (#17747)
  Update dependency vite to v6.2.7 (#17746)
  [red-knot] Update call binding to return all matching overloads (#17618)
  [`airflow`] apply Replacement::AutoImport to `AIR312` (#17570)
  [`ruff`] Add fix safety section (`RUF028`) (#17722)
  [syntax-errors] Detect single starred expression assignment `x = *y` (#17624)
  py-fuzzer: fix minimization logic when `--only-new-bugs` is passed (#17739)
  Fix example syntax for pydocstyle ignore_var_parameters option (#17740)
  [red-knot] Update salsa to prevent panic in custom panic-handler (#17742)
  [red-knot] Ban direct instantiation of generic protocols as well as non-generic ones (#17741)
  [red-knot] Lookup of `__new__` (#17733)
  [red-knot] Check decorator consistency on overloads (#17684)
  [`flake8-use-pathlib`] Avoid suggesting `Path.iterdir()` for `os.listdir` with file descriptor (`PTH208`) (#17715)
  [red-knot] Check overloads without an implementation (#17681)
  Expand Semantic Syntax Coverage (#17725)
  [red-knot] Check for invalid overload usages (#17609)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants