Skip to content

Can Pyright check in CI only committed files? #2620

Answered by erictraut
innerout asked this question in Q&A
Discussion options

You must be logged in to vote

I suppose you could create a script that dynamically writes a new pyrightconfig.json file and specifies only the newly-committed Python files in the "include" section. However, I wouldn't recommend that approach for CI because it will skip type checking for any modules that depend on (i.e., directly or indirectly import from) the newly-committed files.

Pyright also has a "watch mode" where it will run continuously and analyze files that have changed on disk. In this mode, it's able to track dependencies between files, so it doesn't suffer from the problem I mentioned above. However, this mode isn't generally used for CI because CI doesn't run continuously and typically relies on exit code…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by innerout
Comment options

You must be logged in to vote
2 replies
@erictraut
Comment options

@innerout
Comment options

Comment options

You must be logged in to vote
2 replies
@simon376
Comment options

@hmc-cs-mdrissi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants