Skip to content

pyright: Turn off reportMissingImports only in tests directory#1215

Merged
mulkieran merged 1 commit intostratis-storage:masterfrom
mulkieran:pyright-fix
Sep 8, 2025
Merged

pyright: Turn off reportMissingImports only in tests directory#1215
mulkieran merged 1 commit intostratis-storage:masterfrom
mulkieran:pyright-fix

Conversation

@mulkieran
Copy link
Copy Markdown
Member

@mulkieran mulkieran commented Sep 8, 2025

Summary by CodeRabbit

  • Chores
    • Adjusted static analysis configuration so missing-import suppression applies only within the test environment, improving type-check accuracy in other areas.
  • Tests
    • Tightened type-checking behavior for tests to surface import issues during development.

No user-facing changes.

@mulkieran mulkieran self-assigned this Sep 8, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 8, 2025

Walkthrough

Replaces the global Pyright reportMissingImports setting with an executionEnvironments list in pyproject.toml, adding a single environment rooted at tests that sets reportMissingImports = "none", and moves the related bug comment into that environment block.

Changes

Cohort / File(s) Summary of Changes
Pyright config scoping
pyproject.toml
Removed global reportMissingImports setting and added an executionEnvironments entry rooted at tests that sets reportMissingImports = "none"; relocated the existing bug-reference comment into that environment block.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

trivial

"I hopped through configs with tidy feet,
I fenced missing imports to the tests' neat suite.
No global weeds, just a planted row,
Carrots of clarity in tidy tow. 🥕🐇"


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5b7bbc and 2be9158.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-runs (3.13)
  • GitHub Check: test-runs (3.12)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@mulkieran mulkieran moved this to In Progress in 2025September Sep 8, 2025
@mulkieran mulkieran marked this pull request as ready for review September 8, 2025 13:07
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
pyproject.toml (1)

10-10: Prefer severity string over boolean for future-proofing.

Use "none" instead of false to align with documented rule severities and avoid potential schema drift.

-  { root  = "tests", reportMissingImports = false }
+  { root  = "tests", reportMissingImports = "none" }

Docs/examples show per-environment rule severities as strings. (docs.basedpyright.com)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c68dcda and e5b7bbc.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-runs (3.13)
  • GitHub Check: test-runs (3.12)
🔇 Additional comments (1)
pyproject.toml (1)

8-11: Scoped suppression looks good.

Limiting reportMissingImports to tests via executionEnvironments matches the PR goal and the TOML inline-table syntax here is valid for Pyright configs. (fpfortkamp.com)

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran added this to the v3.9.0 milestone Sep 8, 2025
@mulkieran mulkieran merged commit 4623fde into stratis-storage:master Sep 8, 2025
10 checks passed
@mulkieran mulkieran deleted the pyright-fix branch September 8, 2025 13:52
@github-project-automation github-project-automation Bot moved this from In Progress to Done in 2025September Sep 8, 2025
@mulkieran mulkieran moved this from Done to Done(2) in 2025September Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done(2)

Development

Successfully merging this pull request may close these issues.

1 participant