From 0bc0a8b2ed990b10282008a7e7788d7d2703826e Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 21 Jan 2024 23:13:54 -0600 Subject: [PATCH] Ignore "Name shadows builtin" errors because astor gets rid of noqa comments --- pyproject.toml | 1 + src/trio/_core/_generated_io_kqueue.py | 7 ++----- src/trio/_tools/gen_exports.py | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 11935f84bb..28f70b27fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,6 +129,7 @@ extend-exclude = [ 'src/trio/lowlevel.py' = ['F401'] 'src/trio/socket.py' = ['F401'] 'src/trio/testing/__init__.py' = ['F401'] +'src/trio/_core/_generated_io_kqueue.py' = ['A002'] [tool.ruff.isort] combine-as-imports = true diff --git a/src/trio/_core/_generated_io_kqueue.py b/src/trio/_core/_generated_io_kqueue.py index f817c08b85..39662fd902 100644 --- a/src/trio/_core/_generated_io_kqueue.py +++ b/src/trio/_core/_generated_io_kqueue.py @@ -42,8 +42,7 @@ def current_kqueue() -> select.kqueue: def monitor_kevent( - ident: int, - filter: int, # noqa: A002 # Name shadows builtin + ident: int, filter: int ) -> ContextManager[_core.UnboundedQueue[select.kevent]]: """TODO: these are implemented, but are currently more of a sketch than anything real. See `#26 @@ -57,9 +56,7 @@ def monitor_kevent( async def wait_kevent( - ident: int, - filter: int, # noqa: A002 # Name shadows builtin - abort_func: Callable[[RaiseCancelT], Abort], + ident: int, filter: int, abort_func: Callable[[RaiseCancelT], Abort] ) -> Abort: """TODO: these are implemented, but are currently more of a sketch than anything real. See `#26 diff --git a/src/trio/_tools/gen_exports.py b/src/trio/_tools/gen_exports.py index 7156d7015d..0a703dde95 100755 --- a/src/trio/_tools/gen_exports.py +++ b/src/trio/_tools/gen_exports.py @@ -158,6 +158,7 @@ def run_ruff(file: File, source: str) -> tuple[bool, str]: "check", "--fix", "--unsafe-fixes", + "--ignore=A002", "--output-format=text", "--stdin-filename", file.path,