From bee4feedcb6e52aac618c44c7885a558bb73288d Mon Sep 17 00:00:00 2001 From: sudorook Date: Tue, 30 Apr 2024 00:38:12 -0500 Subject: [PATCH 1/3] Recognize .cls extension as Tex file. --- src/reuse/comment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/reuse/comment.py b/src/reuse/comment.py index 0693c591..2d18d192 100644 --- a/src/reuse/comment.py +++ b/src/reuse/comment.py @@ -607,6 +607,7 @@ class XQueryCommentStyle(CommentStyle): ".clj": LispCommentStyle, ".cljc": LispCommentStyle, ".cljs": LispCommentStyle, + ".cls": TexCommentStyle, ".cmake": PythonCommentStyle, # TODO: Bracket comments not supported. ".code-workspace": CCommentStyle, ".coffee": PythonCommentStyle, From 3fee979b45f07d3e69d0bafc0a6467f10471e4d1 Mon Sep 17 00:00:00 2001 From: sudorook Date: Tue, 30 Apr 2024 00:38:21 -0500 Subject: [PATCH 2/3] Parse '%!' in TeX/BibTeX files as shebangs. --- src/reuse/comment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/reuse/comment.py b/src/reuse/comment.py index 2d18d192..b672767b 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): From c064893343b447ec00a9d313b0bc2329d0d59ba6 Mon Sep 17 00:00:00 2001 From: sudorook Date: Fri, 3 May 2024 03:28:35 -0500 Subject: [PATCH 3/3] note tex changes to changelog Signed-off-by: Carmen Bianca BAKKER --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdbaa589..492ba06e 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