mirror of https://github.com/astral-sh/ruff
Allow `pytest` in shebang (#2237)
This commit is contained in:
parent
a6ec2eb044
commit
3ec46f0936
|
|
@ -20,7 +20,7 @@ impl Violation for ShebangPython {
|
||||||
/// EXE003
|
/// EXE003
|
||||||
pub fn shebang_python(lineno: usize, shebang: &ShebangDirective) -> Option<Diagnostic> {
|
pub fn shebang_python(lineno: usize, shebang: &ShebangDirective) -> Option<Diagnostic> {
|
||||||
if let ShebangDirective::Match(_, start, end, content) = shebang {
|
if let ShebangDirective::Match(_, start, end, content) = shebang {
|
||||||
if content.contains("python") {
|
if content.contains("python") || content.contains("pytest") {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let diagnostic = Diagnostic::new(
|
let diagnostic = Diagnostic::new(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue