Avoid missing namespace violations in scripts with shebangs (#8710)

## Summary

I think it's reasonable to avoid raising `INP001` for scripts, and
shebangs are one sufficient way to detect scripts.

Closes https://github.com/astral-sh/ruff/issues/8690.
This commit is contained in:
Charlie Marsh 2023-11-16 14:21:33 -08:00 committed by GitHub
parent d1e88dc984
commit 6d5d079a18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 40 deletions

View file

@ -117,7 +117,7 @@ pub fn check_path(
.iter_enabled()
.any(|rule_code| rule_code.lint_source().is_filesystem())
{
diagnostics.extend(check_file_path(path, package, settings));
diagnostics.extend(check_file_path(path, package, locator, indexer, settings));
}
// Run the logical line-based rules.