From fe334dccb56fad913359ed987b369296e02764fd Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Tue, 24 Sep 2024 13:08:42 -0500 Subject: [PATCH] Ignore `A005` Co-authored-by: A5rocks --- pyproject.toml | 8 ++++++-- src/trio/_abc.py | 3 --- src/trio/_socket.py | 3 --- src/trio/_ssl.py | 3 --- src/trio/abc.py | 2 -- src/trio/socket.py | 3 --- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9abb0bde80..f773d4c703 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -148,9 +148,9 @@ extend-ignore = [ # to export for public use. 'src/trio/__init__.py' = ['F401'] 'src/trio/_core/__init__.py' = ['F401'] -'src/trio/abc.py' = ['F401'] +'src/trio/abc.py' = ['F401', 'A005'] 'src/trio/lowlevel.py' = ['F401'] -'src/trio/socket.py' = ['F401'] +'src/trio/socket.py' = ['F401', 'A005'] 'src/trio/testing/__init__.py' = ['F401'] # RUF029 is ignoring tests that are marked as async functions but # do not use an await in their function bodies. There are several @@ -158,6 +158,10 @@ extend-ignore = [ # called from an async function, where current task is set up. 'src/trio/_tests/*.py' = ['RUF029'] 'src/trio/_core/_tests/*.py' = ['RUF029'] +# A005 is ignoring modules that shadow stdlib modules. +'src/trio/_abc.py' = ['A005'] +'src/trio/_socket.py' = ['A005'] +'src/trio/_ssl.py' = ['A005'] [tool.ruff.lint.isort] combine-as-imports = true diff --git a/src/trio/_abc.py b/src/trio/_abc.py index 4b74ae474a..306ee227fc 100644 --- a/src/trio/_abc.py +++ b/src/trio/_abc.py @@ -1,6 +1,3 @@ -# ruff: noqa: A005 -# Module `_abc` is shadowing a Python builtin module - from __future__ import annotations import socket diff --git a/src/trio/_socket.py b/src/trio/_socket.py index 332bfb5773..9a01009747 100644 --- a/src/trio/_socket.py +++ b/src/trio/_socket.py @@ -1,6 +1,3 @@ -# ruff: noqa: A005 -# Module `_socket` is shadowing a Python builtin module - # ruff: noqa: PYI063 # Several cases throughout file where # argument names with __ used because of typeshed, see comment for recv in _SocketType diff --git a/src/trio/_ssl.py b/src/trio/_ssl.py index d87dc8052f..df1cbc37bc 100644 --- a/src/trio/_ssl.py +++ b/src/trio/_ssl.py @@ -1,6 +1,3 @@ -# ruff: noqa: A005 -# Module `_ssl` is shadowing a Python builtin module - from __future__ import annotations import contextlib diff --git a/src/trio/abc.py b/src/trio/abc.py index 6d2e42c225..439995640e 100644 --- a/src/trio/abc.py +++ b/src/trio/abc.py @@ -1,5 +1,3 @@ -# ruff: noqa: A005 -# Module `abc` is shadowing a Python builtin module # This is a public namespace, so we don't want to expose any non-underscored # attributes that aren't actually part of our public API. But it's very # annoying to carefully always use underscored names for module-level diff --git a/src/trio/socket.py b/src/trio/socket.py index 02f4b65a5f..617f0382c0 100644 --- a/src/trio/socket.py +++ b/src/trio/socket.py @@ -1,6 +1,3 @@ -# ruff: noqa: A005 -# Module `socket` is shadowing a Python builtin module - from __future__ import annotations # This is a public namespace, so we don't want to expose any non-underscored