Skip to content

Commit 978e94c

Browse files
committed
Fix bug in allowed shebangs validation
1 parent 032dd29 commit 978e94c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pre_commit_hooks/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def validate_shebangs(script_content, filename, addl_shebangs=[]):
186186
"""Verifies that scripts begin with a valid shebang."""
187187
passed = True
188188
shebangs = BUILTIN_SHEBANGS + addl_shebangs
189-
if not any((script_content.startswith(x) + "\n" for x in shebangs)):
189+
if not any(script_content.startswith(x + "\n") for x in shebangs):
190190
print(f"{filename}: does not start with a valid shebang")
191191
passed = False
192192
return passed

0 commit comments

Comments
 (0)