[ruff] Do not report when Optional has no type arguments (RUF013) (#14181)
Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions

## Summary

Resolves #13833.

## Test Plan

`cargo nextest run` and `cargo insta test`.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
InSync 2024-11-09 20:48:56 +07:00 committed by GitHub
parent d3f1c8e536
commit c9b84e2a85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 102 additions and 44 deletions

View file

@ -0,0 +1,21 @@
# https://github.com/astral-sh/ruff/issues/13833
from typing import Optional
def no_default(arg: Optional): ...
def has_default(arg: Optional = None): ...
def multiple_1(arg1: Optional, arg2: Optional = None): ...
def multiple_2(arg1: Optional, arg2: Optional = None, arg3: int = None): ...
def return_type(arg: Optional = None) -> Optional: ...
def has_type_argument(arg: Optional[int] = None): ...