Closed jvacek closed 1 day ago
Thanks for the suggestion, but there are already many ways to configure pyright's type checking rules. Adding yet another mechanism isn't something we're likely to do unless there's really strong demand for it.
If I understand your use case correctly, you should be able to accomplish this with execution environments in your config file. Just specify one execution environment for each of the models
and views
subdirectories and enable/disable the rules you want for those directories.
thanks for the prompt reply @erictraut!
Is there any chance these environments could take patterns for the root? My main usecase is that I want target only specific files in a range of dirs.
Is there any chance these environments could take patterns for the root?
That would deviate from the original intent behind execution environments, but it's something we could consider if there's sufficient demand from pyright users. I don't plan to add such a feature at this time, but if this issue gathers enough upvotes, I'd consider re-opening it in the future.
Hmm I would then consider re-creating the issue with a better name in that case, would that be ok?
You should be able to edit the issue title.
I would like to be able to define a setting that would do something like this:
where the LHS defines a pattern, and the RHS assigns file-level type controls as defined here
This would save me putting
# pyright: strict, reportPrivateUsage=false
at the top of every single view file 😬