mirror of https://github.com/astral-sh/ruff
Ignore directories when collecting files to lint
This commit is contained in:
parent
f029f8b784
commit
f0567032d3
|
|
@ -330,9 +330,13 @@ pub fn python_files_in_path(
|
|||
}
|
||||
|
||||
if result.as_ref().map_or(true, |entry| {
|
||||
// Ignore directories
|
||||
if entry.file_type().map_or(true, |ft| ft.is_dir()) {
|
||||
return false;
|
||||
}
|
||||
if entry.depth() == 0 {
|
||||
// Accept all files that are passed-in directly.
|
||||
entry.file_type().map_or(false, |ft| ft.is_file())
|
||||
true
|
||||
} else {
|
||||
// Otherwise, check if the file is included.
|
||||
let path = entry.path();
|
||||
|
|
|
|||
Loading…
Reference in New Issue