[ty] Anchor all exclude patterns (#18685)

Co-authored-by: Andrew Gallant <andrew@astral.sh>
This commit is contained in:
Micha Reiser 2025-06-18 10:57:36 +02:00 committed by GitHub
parent 8184dae287
commit 37fdece72f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 134 additions and 194 deletions

View file

@ -5,9 +5,7 @@ use clap::{ArgAction, ArgMatches, Error, Parser};
use ruff_db::system::SystemPathBuf;
use ty_project::combine::Combine;
use ty_project::metadata::options::{EnvironmentOptions, Options, SrcOptions, TerminalOptions};
use ty_project::metadata::value::{
RangedValue, RelativeExcludePattern, RelativePathBuf, ValueSource,
};
use ty_project::metadata::value::{RangedValue, RelativeGlobPattern, RelativePathBuf, ValueSource};
use ty_python_semantic::lint;
#[derive(Debug, Parser)]
@ -205,12 +203,7 @@ impl CheckCommand {
src: Some(SrcOptions {
respect_ignore_files,
exclude: self.exclude.map(|excludes| {
RangedValue::cli(
excludes
.iter()
.map(|exclude| RelativeExcludePattern::cli(exclude))
.collect(),
)
RangedValue::cli(excludes.iter().map(RelativeGlobPattern::cli).collect())
}),
..SrcOptions::default()
}),