Skip to content

[syntax-errors] Extend annotation checks to await #17282

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 8, 2025

Conversation

ntBre
Copy link
Contributor

@ntBre ntBre commented Apr 7, 2025

Summary

This PR extends the changes in #17101 to include await in the same positions.

I also renamed the valid_annotation_function test to include _py313 and explicitly passed a Python version to contrast it with the _py314 version.

Test Plan

New test cases added to existing files.

Summary
--

This PR extends the changes in #17101 to include `await` in the same positions.

I also renamed the `valid_annotation_function` test to include `_py313` and
explicitly passed a Python version to contrast it with the `_py314` version.

Test Plan
--

New test cases added to existing files.
@ntBre ntBre added rule Implementing or modifying a lint rule preview Related to preview mode features labels Apr 7, 2025
ntBre added a commit that referenced this pull request Apr 7, 2025
Summary
--

This PR extends the checks in #17101 and #17282 to annotated assignments after
Python 3.13.

Currently stacked on #17282 to include `await`.

Test Plan
--

New inline tests. These are simpler than the other cases because there's no
place to put generics.
ntBre added a commit that referenced this pull request Apr 7, 2025
Summary
--

This PR extends the checks in #17101 and #17282 to annotated assignments after
Python 3.13.

Currently stacked on #17282 to include `await`.

Test Plan
--

New inline tests. These are simpler than the other cases because there's no
place to put generics.
Copy link
Contributor

github-actions bot commented Apr 7, 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 merged commit 127a456 into main Apr 8, 2025
22 checks passed
@ntBre ntBre deleted the brent/syn-await-in-annotations branch April 8, 2025 12:55
ntBre added a commit that referenced this pull request Apr 8, 2025
Summary
--

This PR extends the checks in #17101 and #17282 to annotated assignments
after Python 3.13.

Currently stacked on #17282 to include `await`.

Test Plan
--

New inline tests. These are simpler than the other cases because there's
no place to put generics.
dcreager added a commit that referenced this pull request Apr 9, 2025
* origin/main:
  [red-knot] Default `python-platform` to current platform (#17183)
  [red-knot] Add new 'unreachable code' test case (#17306)
  [red-knot] mypy_primer: Run on `async-utils` (#17303)
  [red-knot] Add custom `__setattr__` support (#16748)
  [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512)
  [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274)
  [syntax-errors] Async comprehension in sync comprehension (#17177)
  [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278)
  [syntax-errors] Check annotations in annotated assignments (#17283)
  [syntax-errors] Extend annotation checks to `await` (#17282)
  [red-knot] Add support for `assert_never` (#17287)
  [`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231)
  [red-knot] Do not show types for literal expressions on hover (#17290)
  [red-knot] Fix dead-code clippy warning (#17291)
  [red-knot] Reachability analysis (#17199)
  [red-knot] Don't use latency-sensitive for handlers (#17227)
dcreager added a commit that referenced this pull request Apr 9, 2025
* dcreager/special-class: (26 commits)
  lint
  Add TODO about property test data
  Better todos
  Narrow type(generic) better
  More Python-like displays for specializations
  Add xfail for generic method inside generic class
  Comment other non-specializations
  Explain self_instance not being specialized
  Generic aliases are literals in type display
  Better TODO fallback type
  [red-knot] Default `python-platform` to current platform (#17183)
  [red-knot] Add new 'unreachable code' test case (#17306)
  [red-knot] mypy_primer: Run on `async-utils` (#17303)
  [red-knot] Add custom `__setattr__` support (#16748)
  [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512)
  [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274)
  [syntax-errors] Async comprehension in sync comprehension (#17177)
  [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278)
  [syntax-errors] Check annotations in annotated assignments (#17283)
  [syntax-errors] Extend annotation checks to `await` (#17282)
  ...
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 9, 2025
Summary
--

This PR extends the changes in astral-sh#17101 to include `await` in the same
positions.

I also renamed the `valid_annotation_function` test to include `_py313`
and explicitly passed a Python version to contrast it with the `_py314`
version.

Test Plan
--

New test cases added to existing files.
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request Apr 9, 2025
…#17283)

Summary
--

This PR extends the checks in astral-sh#17101 and astral-sh#17282 to annotated assignments
after Python 3.13.

Currently stacked on astral-sh#17282 to include `await`.

Test Plan
--

New inline tests. These are simpler than the other cases because there's
no place to put generics.
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.

2 participants