Skip to content

Conversation

electron271
Copy link
Member

@electron271 electron271 commented Aug 3, 2025

Description

basedpyright allows for a lot of nicer features, one of the main ones being significantly better compatibility with non vscode editors
see https://docs.basedpyright.com/latest/ and the "Benefits over pyright" section on the documentation for more info

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

ran basedpyright to check types

Screenshots (if applicable)

Please add screenshots to help explain your changes.

Additional Information

Please add any other information that is important to this PR.

Summary by Sourcery

Switch from Pyright to BasedPyright for static type checking across the project

Enhancements:

  • Adopt BasedPyright to improve compatibility with non-VS Code editors

Build:

  • Update GitHub Actions CI to run BasedPyright instead of Pyright

Documentation:

  • Revise documentation and contributing guidelines to refer to BasedPyright instead of Pyright

Chores:

  • Replace Pyright dependency and configuration in pyproject.toml and tool config
  • Update local CLI command to invoke BasedPyright for type checks

@electron271 electron271 requested a review from kzndotsh August 3, 2025 06:58
@electron271 electron271 self-assigned this Aug 3, 2025
Copy link
Contributor

sourcery-ai bot commented Aug 3, 2025

Reviewer's Guide

This PR replaces Pyright with Basedpyright as the project’s static type checker by updating the CI pipeline, project dependencies and configuration, CLI commands, and documentation to use and configure basedpyright.

Class diagram for CLI dev commands type checker switch

classDiagram
    class DevCommands {
        +format_code() int
        +type_check() int
        +pre_commit() int
    }
    DevCommands : type_check() now runs basedpyright
    DevCommands : type_check() previously ran pyright
Loading

File-Level Changes

Change Details Files
CI workflow updates to use basedpyright for type checking
  • Updated CI comments and tool reference from Pyright to basedpyright
  • Replaced pyright-action step with a direct basedpyright run command
.github/workflows/ci.yml
Swap pyright dependency for basedpyright in dev dependencies
  • Removed pyright from Poetry dev dependencies
  • Added basedpyright at a pinned version
  • Regenerated lockfile to reflect the change
pyproject.toml
poetry.lock
Migrate type checker configuration to basedpyright
  • Renamed the [tool.pyright] section to [tool.basedpyright]
  • Added a reportRedeclaration setting
pyproject.toml
Update CLI command for type checking
  • Changed the docstring to reference basedpyright
  • Modified the run_command invocation to call basedpyright
tux/cli/dev.py
Refresh project documentation to reflect basedpyright usage
  • Replaced Pyright references with basedpyright in CONTRIBUTING.md
  • Updated README.md typing section accordingly
.github/CONTRIBUTING.md
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

github-actions bot commented Aug 3, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
pip/basedpyright 1.29.5 UnknownUnknown
pip/nodejs-wheel-binaries 22.18.0 UnknownUnknown

Scanned Files

  • .github/workflows/ci.yml
  • poetry.lock

@electron271 electron271 added category: meta Relating to architecture, systems and critical functions priority: medium labels Aug 3, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @electron271 - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

cloudflare-workers-and-pages bot commented Aug 3, 2025

Deploying tux with  Cloudflare Pages  Cloudflare Pages

Latest commit: f75fcaa
Status: ✅  Deploy successful!
Preview URL: https://336457f8.tux-afh.pages.dev
Branch Preview URL: https://basedpyright.tux-afh.pages.dev

View logs

Copy link

codecov bot commented Aug 3, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 9.57%. Comparing base (85084b5) to head (f75fcaa).
⚠️ Report is 12 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tux/cli/dev.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1001   +/-   ##
=====================================
  Coverage   9.57%   9.57%           
=====================================
  Files        123     123           
  Lines      10415   10415           
  Branches    1279    1279           
=====================================
  Hits         997     997           
  Misses      9316    9316           
  Partials     102     102           
Flag Coverage Δ *Carryforward flag
database 0.31% <ø> (+<0.01%) ⬆️ Carriedforward from 3c80b01
integration 5.85% <0.00%> (ø)
unit 6.30% <0.00%> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Components Coverage Δ
Core Bot Infrastructure 16.43% <ø> (ø)
Database Layer 0.00% <ø> (ø)
Bot Commands & Features 0.00% <ø> (ø)
Event & Error Handling ∅ <ø> (∅)
Utilities & Helpers ∅ <ø> (∅)
User Interface Components 0.00% <ø> (ø)
CLI Interface ∅ <ø> (∅)
External Service Wrappers ∅ <ø> (∅)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@electron271 electron271 merged commit 567b270 into main Aug 8, 2025
36 checks passed
@electron271 electron271 deleted the basedpyright branch August 8, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: meta Relating to architecture, systems and critical functions priority: medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant