diff --git a/CHANGELOG.md b/CHANGELOG.md index fdbaa5893..492ba06ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,9 +56,12 @@ CLI command and its behaviour. There are no guarantees of stability for the - Java `.properties` files (#968) - Apache HTTP server config `.htaccess` files (#985) - npm `.npmrc` files (#985) + - LaTeX class files (`.cls`) (#971) - Added comment styles: - `man` for UNIX Man pages (`.man`) (#954) - Added `--lines` output option for `lint`. (#956) +- Treat `% !TEX` and `% !BIB` as shebangs in TeX and BibTeX files, respectively + (#971) ### Changed diff --git a/src/reuse/comment.py b/src/reuse/comment.py index 0693c591b..b672767bf 100644 --- a/src/reuse/comment.py +++ b/src/reuse/comment.py @@ -321,6 +321,7 @@ class BibTexCommentStyle(CommentStyle): SHORTHAND = "bibtex" MULTI_LINE = MultiLineSegments("@Comment{", "", "}") + SHEBANGS = ["% !BIB", "%!BIB"] class CCommentStyle(CommentStyle): @@ -525,6 +526,7 @@ class TexCommentStyle(CommentStyle): SINGLE_LINE = "%" INDENT_AFTER_SINGLE = " " + SHEBANGS = ["% !TEX", "%!TEX"] class UncommentableCommentStyle(EmptyCommentStyle): @@ -607,6 +609,7 @@ class XQueryCommentStyle(CommentStyle): ".clj": LispCommentStyle, ".cljc": LispCommentStyle, ".cljs": LispCommentStyle, + ".cls": TexCommentStyle, ".cmake": PythonCommentStyle, # TODO: Bracket comments not supported. ".code-workspace": CCommentStyle, ".coffee": PythonCommentStyle,