[ty] Add --exclude-scripts and --include-scripts - #27169
Conversation
|
|
||
| project.set_verbose(&mut db, verbosity >= VerbosityLevel::Verbose); | ||
| project.set_force_exclude(&mut db, force_exclude); | ||
| project.set_exclude_scripts(&mut db, exclude_scripts); |
There was a problem hiding this comment.
I guess that's fine for now. We might want to move it, once we support setting it via configuration
There was a problem hiding this comment.
Nah let's do it right, I just don't know what I'm doing with config x3
There was a problem hiding this comment.
I'm okay deferring. It may even be easier if the config option has a different name (e.g. scripts = true/false).
There was a problem hiding this comment.
I'm also a big fan of only adding config options once people ask for them :)
Typing conformance resultsNo changes detected ✅Current numbersThe percentage of diagnostics emitted that were expected errors held steady at 96.84%. The percentage of expected errors that received a diagnostic held steady at 92.11%. The number of fully passing files held steady at 99/133. |
Memory usage reportMemory usage unchanged ✅ |
|
5690e31 to
0a59fe1
Compare
| )] | ||
| exclude_scripts: Option<bool>, | ||
| #[clap(long, overrides_with("exclude_scripts"), hide = true)] | ||
| no_exclude_scripts: bool, |
There was a problem hiding this comment.
I think I'd prefer --include-scripts here
0a59fe1 to
9e45650
Compare
9e45650 to
8dddb4a
Compare
--exclude-scripts --exclude-scripts and --include-scripts
This is a 3rd pseudo-alternative to
uv checkunless--scriptis passed uv#20676which @MichaReiser suggested as a way to ask for the desired behaviour that becomes "standard API" and not like, some random "oh are we doing uv?" escape-hatch.
Notably here a PEP 723 script is only excluded if it's "implicitly selected" in much the same way that this still checks
bar.py:ty check --exclude foo/ -- foo/bar.py--include-scriptsis the default and exists only to negate--exclude-scriptsin e.g. config-vs-cli-arg fights (and maybe will be nice if we ever change the default).