Skip to content

Conversation

@charliermarsh
Copy link
Member

Closes #12412.

@charliermarsh charliermarsh marked this pull request as ready for review July 20, 2024 01:19
@charliermarsh charliermarsh added the bug Something isn't working label Jul 20, 2024
@github-actions
Copy link
Contributor

ruff-ecosystem results

Linter (stable)

ℹ️ ecosystem check detected linter changes. (+0 -6 violations, +0 -0 fixes in 2 projects; 52 projects unchanged)

bokeh/bokeh (+0 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

- src/bokeh/core/property/enum.py:57:78: A002 Argument `help` is shadowing a Python builtin
- src/bokeh/core/property/enum.py:59:75: A002 Argument `help` is shadowing a Python builtin

zulip/zulip (+0 -4 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --no-preview --select ALL

- zerver/lib/db.py:38:37: A002 Argument `vars` is shadowing a Python builtin
- zerver/tests/test_auth_backends.py:1954:9: A002 Argument `next` is shadowing a Python builtin
- zerver/tests/test_auth_backends.py:3475:9: A002 Argument `next` is shadowing a Python builtin
- zerver/tests/test_auth_backends.py:3521:9: A002 Argument `next` is shadowing a Python builtin

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
A002 6 0 6 0 0

Linter (preview)

ℹ️ ecosystem check detected linter changes. (+0 -6 violations, +0 -0 fixes in 2 projects; 52 projects unchanged)

bokeh/bokeh (+0 -2 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- src/bokeh/core/property/enum.py:57:78: A002 Argument `help` is shadowing a Python builtin
- src/bokeh/core/property/enum.py:59:75: A002 Argument `help` is shadowing a Python builtin

zulip/zulip (+0 -4 violations, +0 -0 fixes)

ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL

- zerver/lib/db.py:38:37: A002 Argument `vars` is shadowing a Python builtin
- zerver/tests/test_auth_backends.py:1954:9: A002 Argument `next` is shadowing a Python builtin
- zerver/tests/test_auth_backends.py:3475:9: A002 Argument `next` is shadowing a Python builtin
- zerver/tests/test_auth_backends.py:3521:9: A002 Argument `next` is shadowing a Python builtin

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
A002 6 0 6 0 0

@charliermarsh charliermarsh merged commit 4bcc96a into main Jul 20, 2024
@charliermarsh charliermarsh deleted the charlie/o branch July 20, 2024 01:32
@cbornet
Copy link

cbornet commented Aug 22, 2024

I'm not sure it's good to always ignore the rule on overrides.
I have some classes that look like this:

class A:
    def foo(**kwargs):
        pass

class B(A):
    @override
    def foo(*, filter, **kwargs):
        pass

Previously, it was triggering A002 because filter is a builtin which I had to silence (couldn't rename because of backward compatibility).
I think that was fair.
But now the rule is not triggered anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

builtin-argument-shadowing (A002) should not fire when overriding

3 participants