mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Root exclusions in the server to project root (#16043)
## Summary fixes: #16041 ## Test Plan Using the [project](https://github.com/bwcc-clan/polebot) in the linked issue: Notice how the project "polebot" is in the "play" directory which is included in the `exclude` setting as: ```toml exclude = ["play"] ``` **Before this fix** ``` DEBUG ruff:worker:0 ruff_server::resolve: Ignored path via `exclude`: /private/tmp/ruff-test/play/polebot/src/utils/log_tools.py ``` **After this fix** ``` DEBUG ruff:worker:2 ruff_server::resolve: Included path via `include`: /private/tmp/ruff-test/play/polebot/src/utils/log_tools.py ``` I also updated the same project to remove the "play" directory from the `exclude` setting and made sure that anything under the `polebot/play` directory is included: ``` DEBUG ruff:worker:4 ruff_server::resolve: Included path via `include`: /private/tmp/ruff-test/play/polebot/play/test.py ``` And, excluded when I add the directory back: ``` DEBUG ruff:worker:2 ruff_server::resolve: Ignored path via `exclude`: /private/tmp/ruff-test/play/polebot/play/test.py ```
This commit is contained in:
parent
cc0a5dd14a
commit
869a9543e4
2 changed files with 14 additions and 16 deletions
|
@ -59,8 +59,7 @@ fn is_document_excluded(
|
|||
) -> bool {
|
||||
if let Some(exclusion) = match_any_exclusion(
|
||||
path,
|
||||
&resolver_settings.exclude,
|
||||
&resolver_settings.extend_exclude,
|
||||
resolver_settings,
|
||||
linter_settings.map(|s| &*s.exclude),
|
||||
formatter_settings.map(|s| &*s.exclude),
|
||||
) {
|
||||
|
@ -68,11 +67,7 @@ fn is_document_excluded(
|
|||
return true;
|
||||
}
|
||||
|
||||
if let Some(inclusion) = match_any_inclusion(
|
||||
path,
|
||||
&resolver_settings.include,
|
||||
&resolver_settings.extend_include,
|
||||
) {
|
||||
if let Some(inclusion) = match_any_inclusion(path, resolver_settings) {
|
||||
tracing::debug!("Included path via `{}`: {}", inclusion, path.display());
|
||||
false
|
||||
} else if let Some(LanguageId::Python) = language_id {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue