From 16326c6b28cd844935c5102bff971f163b9eb452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Alet?= Date: Mon, 20 Dec 2021 07:36:57 +1100 Subject: [PATCH] fix: faster check for shebang, thanks to @adrienverge --- yamllint/rules/comments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yamllint/rules/comments.py b/yamllint/rules/comments.py index 74d8142..02eddad 100644 --- a/yamllint/rules/comments.py +++ b/yamllint/rules/comments.py @@ -103,7 +103,7 @@ def check(conf, comment): if (conf['ignore-shebangs'] and comment.line_no == 1 and comment.column_no == 1 and - comment.buffer[text_start:].startswith('!')): + comment.buffer[text_start] == '!'): return # We can test for both \r and \r\n just by checking first char # \r itself is a valid newline on some older OS.