From 85b5505683eb996360e8f378151b561bfb8b2b24 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Sun, 8 Nov 2026 20:16:09 +0800 Subject: [PATCH 1/2] feat: add basedpyright to Type Checkers Challenger after pyright: 15.7% share in the 2026 Python Typing Survey (up from 10.9% in 2025) and 16.7M downloads/month via ClickPy vs pyrefly's 10.4M. Its only dependency is nodejs-wheel-binaries, so the count is independent demand, and the repo is active (last push 2026-10-28). Co-Authored-By: Claude --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e0c06a6c..bb00ad87 100644 --- a/README.md +++ b/README.md @@ -669,6 +669,7 @@ _Tools for static analysis, linters and code quality checkers. Also see [awesome - [mypy](https://github.com/python/mypy) - A static type checker for Python. - [ty](https://github.com/astral-sh/ty) - An extremely fast Python type checker and language server. - [pyright](https://github.com/microsoft/pyright) - Full-featured static type checker for Python from Microsoft, the engine behind Pylance. + - [basedpyright](https://github.com/DetachHead/basedpyright) - A pyright fork with stricter defaults and Pylance features in its language server. - [pyrefly](https://github.com/meta/pyrefly) - A fast type checker and language server for Python. ### Testing From 7aee6906a1b1dbdaed34e1abc0349b20b64b1d20 Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Sun, 8 Nov 2026 20:19:21 +0800 Subject: [PATCH 2/2] docs: add basedpyright to Code Analysis category intro Co-Authored-By: Claude --- website/data/category_intros/code-analysis.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/data/category_intros/code-analysis.md b/website/data/category_intros/code-analysis.md index fc90f016..fadaa96d 100644 --- a/website/data/category_intros/code-analysis.md +++ b/website/data/category_intros/code-analysis.md @@ -14,7 +14,7 @@ How to choose: - Refactoring: Rope from your editor or a script, ast-grep for pattern rewrites - Type checking Django or Pydantic code: mypy with its plugins, Pyrefly without - Adding types to a partly typed codebase: ty -- Type checking in VS Code: Pyright, which Pylance runs on +- Type checking in your editor: Pyright in VS Code via Pylance, basedpyright in other editors Ruff [can replace Flake8, Black, and isort](https://docs.astral.sh/ruff/), plus dozens of Flake8 plugins. Its docs suggest you [start with a small rule set](https://docs.astral.sh/ruff/linter/#rule-selection), add one group at a time, and list them explicitly in `select`. Ruff is [a linter, not a type checker](https://docs.astral.sh/ruff/faq/#how-does-ruff-compare-to-ty-mypy-pyright-or-pyre), so run a type checker alongside it. @@ -48,4 +48,6 @@ ty is a type checker and language server [designed for adoption](https://docs.as Pyright [checks all code by default](https://github.com/microsoft/pyright/blob/main/docs/mypy-comparison.md#type-checking-unannotated-code), annotated or not, which its language server features rely on. In VS Code, its docs [recommend Pylance](https://github.com/microsoft/pyright/blob/main/docs/installation.md), which includes Pyright. Run it [in CI to keep the project type clean](https://github.com/microsoft/pyright/blob/main/docs/getting-started.md), then turn on `# pyright: strict` file by file. +basedpyright is a fork of Pyright that [re-implements some of Pylance's features](https://docs.basedpyright.com/latest/benefits-over-pyright/pylance-features/) in its language server, so you get them in any editor. It [turns on every rule by default](https://docs.basedpyright.com/latest/benefits-over-pyright/better-defaults/). On an existing project, run `basedpyright --writebaseline` and commit the file it writes, so it [reports errors only in new or changed code](https://docs.basedpyright.com/latest/benefits-over-pyright/baseline/). + Pylint, Prospector, Import Linter, and ty all need to see your project's dependencies, so run them [from the project's own environment](https://pylint.readthedocs.io/en/latest/user_guide/installation/pre-commit-integration.html), not a separate one. For more Python code analysis tools, see [awesome-static-analysis](https://github.com/analysis-tools-dev/static-analysis).