Skip to content

Add bugbear linter to ruff linter emulations - #1296

Merged
mulkieran merged 2 commits into
stratis-storage:masterfrom
mulkieran:enable-bugbear-linter
Sep 11, 2026
Merged

Add bugbear linter to ruff linter emulations#1296
mulkieran merged 2 commits into
stratis-storage:masterfrom
mulkieran:enable-bugbear-linter

Conversation

@mulkieran

@mulkieran mulkieran commented Sep 11, 2026

Copy link
Copy Markdown
Member

@mulkieran mulkieran self-assigned this Sep 11, 2026
@mulkieran mulkieran moved this to In Progress in 2026September Sep 11, 2026
@mulkieran
mulkieran force-pushed the enable-bugbear-linter branch from eaec87b to 17cccb4 Compare September 11, 2026 13:34
Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran
mulkieran force-pushed the enable-bugbear-linter branch from 17cccb4 to 1ccaf7f Compare September 11, 2026 13:35
It is observed by Python type analyzers like pyright and
the assertion is not optimized away, as assert can be
with some Python compilation flags.

Assisted-by: Claude:claude-sonnet-4-5
Signed-off-by: the Mulhern <amulhern@amulhern.bos.csb>
@mulkieran
mulkieran force-pushed the enable-bugbear-linter branch from 1ccaf7f to 1d24d7d Compare September 11, 2026 13:42
@mulkieran

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mulkieran
mulkieran marked this pull request as ready for review September 11, 2026 13:44
@mulkieran mulkieran moved this from In Progress to In Review in 2026September Sep 11, 2026
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 4e9068f1-24f3-4736-8387-18ba18307d0f

📥 Commits

Reviewing files that changed from the base of the PR and between c338ff8 and 1d24d7d.

📒 Files selected for processing (5)
  • pyproject.toml
  • src/stratis_cli/_actions/_data.py
  • src/stratis_cli/_actions/_formatting.py
  • src/stratis_cli/_alerts.py
  • src/stratis_cli/_parser/_shared.py

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The project enables Ruff bugbear rules and updates affected code. Changes add strict iterable-length validation, direct attribute access, and assert_never fallbacks for exhaustive type handling.

Changes

Ruff lint updates

Layer / File(s) Summary
Bugbear-compatible implementations
pyproject.toml, src/stratis_cli/_actions/_data.py, src/stratis_cli/_actions/_formatting.py
Ruff enables the B rule set. Table formatting uses strict zip, and D-Bus method access uses direct attribute access.
Exhaustive type assertions
src/stratis_cli/_alerts.py, src/stratis_cli/_parser/_shared.py
Unreachable assert False fallbacks use assert_never in alert methods and unit-specifier handling.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 1d24d

The lint updates are mergeable with no identified runtime or integration risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 92.86% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 4 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling Ruff's bugbear rules for the project.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mulkieran
mulkieran merged commit 6bd5edb into stratis-storage:master Sep 11, 2026
8 checks passed
@mulkieran
mulkieran deleted the enable-bugbear-linter branch September 11, 2026 14:11
@github-project-automation github-project-automation Bot moved this from In Review to Done in 2026September Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant