From f15fcf0e22c22c15838a3e996645ae2098222cb3 Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Fri, 8 Jan 2016 16:04:39 -0800 Subject: [PATCH] Clarify docstring in shebang reader --- pre_commit/file_classifier/classifier.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pre_commit/file_classifier/classifier.py b/pre_commit/file_classifier/classifier.py index 907742ca..162d2b85 100644 --- a/pre_commit/file_classifier/classifier.py +++ b/pre_commit/file_classifier/classifier.py @@ -85,9 +85,10 @@ def _guess_types_from_shebang(path): def _read_interpreter_from_shebang(path): """Read an interpreter from a file's shebang. - The first line of a script is guaranteed to be ASCII, so we read ASCII - until we hit a newline (at which point we check if we read a valid shebang) - or a non-ASCII character (at which point we bail). + The first line of a script which has a valid shebang is guaranteed to be + ASCII, so we read ASCII until we hit a newline (at which point we check if + we read a valid shebang) or a non-ASCII character (at which point we bail, + because this can't be a valid script-with-shebang). :param path: path to text file :return: interpreter, or None if no shebang could be read