Skip to content

Ignore non-abstract class attributes when enforcing B024#11210

Merged
charliermarsh merged 2 commits intomainfrom
charlie/b
Apr 30, 2024
Merged

Ignore non-abstract class attributes when enforcing B024#11210
charliermarsh merged 2 commits intomainfrom
charlie/b

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

I think the check included here does make sense, but I don't see why we would allow it if a value is provided for the attribute -- since, in that case, isn't it not abstract?

Closes: #11208.

@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Apr 30, 2024
@charliermarsh charliermarsh marked this pull request as ready for review April 30, 2024 03:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 30, 2024

ruff-ecosystem results

Linter (stable)

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

DisnakeDev/disnake (+1 -0 violations, +0 -0 fixes)

+ disnake/app_commands.py:468:7: B024 `ApplicationCommand` is an abstract base class, but it has no abstract methods

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
B024 1 1 0 0 0

Linter (preview)

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

DisnakeDev/disnake (+1 -0 violations, +0 -0 fixes)

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

+ disnake/app_commands.py:468:7: B024 `ApplicationCommand` is an abstract base class, but it has no abstract methods

Changes by rule (1 rules affected)

code total + violation - violation + fix - fix
B024 1 1 0 0 0

Copy link
Copy Markdown
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I pushed to your branch to fix a couple of micro-nits I had ;)

@charliermarsh charliermarsh merged commit c5adbf1 into main Apr 30, 2024
@charliermarsh charliermarsh deleted the charlie/b branch April 30, 2024 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B024 false negative when there's a class var

2 participants