Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
A remaining map() call will fail the enabled B912 lint check, and boolean operations should use strict=True.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
Updates Ruff configuration to enable B912 and adds explicit strict=False arguments to map() calls.
Changes:
- Removes B912 from Ruff’s ignore list.
- Adds explicit map strictness to BitVector operations.
- Leaves B905 ignored and one
map()call withoutstrict=.
| File | Summary |
|---|---|
pyproject.toml |
Enables B912 linting; B905 remains ignored. |
BitVector/BitVector.py |
Updates map calls, but leaves one B912 violation and uses non-strict boolean operations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -78,7 +78,6 @@ select = ["ALL"] | |||
| ignore = [ | |||
| "ANN001", # missing-type-function-argument | |||
| "ANN401", # any-type | |||
| "ANN001", # missing-type-function-argument | ||
| "ANN401", # any-type | ||
| "B912", # map-without-explicit-strict | ||
| "B905", # zip-without-explicit-strict |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Code Review & Suggestions for Improvement
__xor__,__and__,__or__(and their in-place equivalents), self.vector and bv2.vector are expected to have the same number of words after padding/resizing.strict=Falsetostrict=Truefor these operations would catch any silent truncations or unexpected array size mismatches earlier as an explicit ValueError.shift_left_by_oneandshift_right_by_one, repeated construction of temporary lists([1] * size, [63] * size)and multiplemap()calls create unnecessary memory allocations. A single list comprehension or directword loop across self.vector would be clearer and faster.
zip()calls would further improve safety and consistency across the codebase.