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

Implement B006 #515

Merged
merged 5 commits into from Oct 30, 2022
Merged

Implement B006 #515

merged 5 commits into from Oct 30, 2022

Conversation

harupy
Copy link
Contributor

@harupy harupy commented Oct 30, 2022

See #389

Signed-off-by: harupy <hkawamura0130@gmail.com>
@@ -887,6 +891,7 @@ impl CheckCodePrefix {
CheckCodePrefix::B0 => PrefixSpecificity::Hundreds,
CheckCodePrefix::B00 => PrefixSpecificity::Tens,
CheckCodePrefix::B002 => PrefixSpecificity::Explicit,
CheckCodePrefix::B006 => PrefixSpecificity::Explicit,
Copy link
Member

Choose a reason for hiding this comment

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

@harupy - BTW -- any thoughts on the approach I took to this problem? I.e., code-generating the prefix map, to allow static enums everywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How does flake8 implement this?

@@ -0,0 +1,61 @@
import collections
Copy link
Member

Choose a reason for hiding this comment

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

Could we instead use the test suite from flake8-bugbear? https://github.com/PyCQA/flake8-bugbear/blob/main/tests/b006_b008.py

@charliermarsh
Copy link
Member

Awesome, a couple comments!

@charliermarsh charliermarsh merged commit 7ecbfe4 into astral-sh:main Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants