mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-27 20:42:10 +00:00
Add [format|lint].exclude options (#8000)
This commit is contained in:
parent
d685107638
commit
fe485d791c
22 changed files with 772 additions and 294 deletions
|
|
@ -161,7 +161,7 @@ mod tests {
|
|||
use ruff_linter::line_width::LineLength;
|
||||
use ruff_linter::settings::types::PatternPrefixPair;
|
||||
|
||||
use crate::options::{LintOptions, Options};
|
||||
use crate::options::{LintCommonOptions, Options};
|
||||
use crate::pyproject::{find_settings_toml, parse_pyproject_toml, Pyproject, Tools};
|
||||
use crate::tests::test_resource_path;
|
||||
|
||||
|
|
@ -236,9 +236,9 @@ select = ["E501"]
|
|||
pyproject.tool,
|
||||
Some(Tools {
|
||||
ruff: Some(Options {
|
||||
lint_top_level: LintOptions {
|
||||
lint_top_level: LintCommonOptions {
|
||||
select: Some(vec![codes::Pycodestyle::E501.into()]),
|
||||
..LintOptions::default()
|
||||
..LintCommonOptions::default()
|
||||
},
|
||||
..Options::default()
|
||||
})
|
||||
|
|
@ -257,10 +257,10 @@ ignore = ["E501"]
|
|||
pyproject.tool,
|
||||
Some(Tools {
|
||||
ruff: Some(Options {
|
||||
lint_top_level: LintOptions {
|
||||
lint_top_level: LintCommonOptions {
|
||||
extend_select: Some(vec![codes::Ruff::_100.into()]),
|
||||
ignore: Some(vec![codes::Pycodestyle::E501.into()]),
|
||||
..LintOptions::default()
|
||||
..LintCommonOptions::default()
|
||||
},
|
||||
..Options::default()
|
||||
})
|
||||
|
|
@ -315,12 +315,12 @@ other-attribute = 1
|
|||
"with_excluded_file/other_excluded_file.py".to_string(),
|
||||
]),
|
||||
|
||||
lint_top_level: LintOptions {
|
||||
lint_top_level: LintCommonOptions {
|
||||
per_file_ignores: Some(FxHashMap::from_iter([(
|
||||
"__init__.py".to_string(),
|
||||
vec![codes::Pyflakes::_401.into()]
|
||||
)])),
|
||||
..LintOptions::default()
|
||||
..LintCommonOptions::default()
|
||||
},
|
||||
..Options::default()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue