mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
Conside include
, extend-include
for the native server (#12252)
## Summary
This PR updates the native server to consider the `include` and
`extend-include` file resolver settings.
fixes: #12242
## Test Plan
Note: Settings reloading doesn't work for nested configs which is fixed
in #12253 so the preview here only showcases root level config.
e8969128
-c175-4f98-8114-0d692b906cc8
This commit is contained in:
parent
855d62cdde
commit
0bb2fc6eec
10 changed files with 101 additions and 47 deletions
|
@ -9,10 +9,10 @@ use ruff_linter::{
|
|||
};
|
||||
use ruff_notebook::SourceValue;
|
||||
use ruff_source_file::LineIndex;
|
||||
use ruff_workspace::resolver::match_any_exclusion;
|
||||
|
||||
use crate::{
|
||||
edit::{Replacement, ToRangeExt},
|
||||
resolve::is_document_excluded,
|
||||
session::DocumentQuery,
|
||||
PositionEncoding,
|
||||
};
|
||||
|
@ -33,18 +33,12 @@ pub(crate) fn fix_all(
|
|||
|
||||
// If the document is excluded, return an empty list of fixes.
|
||||
let package = if let Some(document_path) = document_path.as_ref() {
|
||||
if let Some(exclusion) = match_any_exclusion(
|
||||
if is_document_excluded(
|
||||
document_path,
|
||||
&file_resolver_settings.exclude,
|
||||
&file_resolver_settings.extend_exclude,
|
||||
Some(&linter_settings.exclude),
|
||||
file_resolver_settings,
|
||||
Some(linter_settings),
|
||||
None,
|
||||
) {
|
||||
tracing::debug!(
|
||||
"Ignored path via `{}`: {}",
|
||||
exclusion,
|
||||
document_path.display()
|
||||
);
|
||||
return Ok(Fixes::default());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue