Allow pytest in shebang (#2237)

This commit is contained in:
Charlie Marsh 2023-01-26 17:32:23 -05:00 committed by GitHub
parent a6ec2eb044
commit 3ec46f0936
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ impl Violation for ShebangPython {
/// EXE003
pub fn shebang_python(lineno: usize, shebang: &ShebangDirective) -> Option<Diagnostic> {
if let ShebangDirective::Match(_, start, end, content) = shebang {
if content.contains("python") {
if content.contains("python") || content.contains("pytest") {
None
} else {
let diagnostic = Diagnostic::new(