pyright: init#504
Conversation
Drops the hand-rolled `settings.formatter.pyright` block in favour of the upcoming `programs.pyright` module from numtide/treefmt-nix#504. The `treefmt-nix` flake input is temporarily pinned to the PR branch (`otavio/treefmt-nix/pyright-init`); switch back to `numtide/treefmt-nix` once the PR lands upstream. The `--pythonpath` workaround for pytest import resolution is preserved via `directories."".options`.
|
Self-review pass on the 1. Default 2. 3. Trailing dash in formatter name ( 4. 5. Test plan describes config-eval as "end-to-end" — clarified, no code change. The 6. Bonus follow-up (not in this PR): Verification of the amended commit:
|
3efcf30 to
ed5dc86
Compare
otavio
left a comment
There was a problem hiding this comment.
Self-review pass mapping each original change request to its inline location in the amended diff. See per-line comments below.
|
Update on top of the earlier summary — all review threads are now resolved. Additional changes folded into the same
CI is green ( |
d3613c9 to
1747944
Compare
Add support for the Pyright Python static type checker, mirroring the mypy module's per-directory invocation pattern: pyright needs whole-module context to resolve imports, so it runs once per configured directory rather than per changed file. Unlike mypy, pyright does not honor PYTHONPATH for import resolution, so the extraPythonPackages/extraPythonPaths knobs were intentionally omitted. The option description points users at extraPaths in pyrightconfig.json or [tool.pyright] instead.
Summary
programs.pyrightmodule for the Pyright Python static type checker.extraPythonPackages/extraPythonPathsbecause pyright does not consultPYTHONPATH— the option description steers users toextraPathsinpyrightconfig.json/[tool.pyright]instead.Test plan
nix build .#checks.x86_64-linux.formatter-pyrightsucceeds and produces a valid treefmt config.nix build .#checks.x86_64-linux.examplessucceeds (pyright isskipExample, since the wrapper bakes store paths).<dir>/<module>/*.pyand*.pyi, and the wrapper invokespyright <options> <modules>from the configured directory.