Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B024: Missed error code #275

Closed
decaz opened this issue Aug 22, 2022 · 6 comments · Fixed by #276
Closed

B024: Missed error code #275

decaz opened this issue Aug 22, 2022 · 6 comments · Fixed by #276

Comments

@decaz
Copy link

decaz commented Aug 22, 2022

Error code is missed here:

flake8-bugbear/bugbear.py

Lines 1174 to 1179 in 1007f5c

B024 = Error(
message=(
"{} is an abstract base class, but it has no abstract methods. Remember to use"
" @abstractmethod, @abstractclassmethod and/or @abstractproperty decorators."
)
)

Should be "B024 {} is an abstract ...".

Refs #274
CC @jakkdl @Zac-HD

@cooperlees
Copy link
Collaborator

Thanks for reporting. I'll try get a fix out this week unless someone beats me. Bummer we missed this in review.

@Zac-HD
Copy link
Member

Zac-HD commented Aug 22, 2022

🤔 we could add a check to the Error constructor that messages start with B\d\d\d:

samueljsb added a commit to samueljsb/flake8-bugbear that referenced this issue Aug 23, 2022
@samueljsb
Copy link
Contributor

I've suggested a fix for the missing error code in #276.

@Zac-HD I can look at adding a check to Error, or I can leave that for you if you prefer?

@DaniilAnichin
Copy link

Kinda-important, because without code one cannot ignore B024 in flake8 settings;
Also, what was the reasoning behind making it enabled by default?
Abstract class can have no abstract properties, it's not required or something

@jakkdl
Copy link
Contributor

jakkdl commented Aug 23, 2022

Ah sorry, in flake8-trio I define the error messages in the dict with the code as a key, and the key is pre-pended to the error message. Thanks for spotting it quickly :)

@cooperlees cooperlees changed the title Missed error code B024: Missed error code Aug 23, 2022
@cooperlees
Copy link
Collaborator

FWIW 22.8.23 is released + 22.8.22 is yanked.

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

Successfully merging a pull request may close this issue.

6 participants