Commits

Jin Hui committed 9a7c5cf

fixed detection_shebang order

Comments (0)

Files changed (1)

             if not language:
                 basename = os.path.splitext(path)[0]
                 ext = os.path.splitext(path)[-1]
-                if ext:
-                    language = LANGUAGE_BY_FILE.get(basename) or LANGUAGE_BY_EXTENSION.get(ext)
-                else:
-                    language = detection_shebang(lines)
+                language = LANGUAGE_BY_FILE.get(basename) or LANGUAGE_BY_EXTENSION.get(ext)
+
+            if not language:
+                language = detection_shebang(lines)
 
             if language:
                 total_lines = len(lines)