From 5082c5bc8296b0cc4d1a34b6685431ca4738b8dd Mon Sep 17 00:00:00 2001 From: Alex Railean Date: Thu, 14 Nov 2024 10:05:39 +0100 Subject: [PATCH] Add support for RobotFramework --- AUTHORS.rst | 1 + changelog.d/feature.784e2262.entry.yaml | 7 +++++++ src/reuse/comment.py | 11 +++++++++++ 3 files changed, 19 insertions(+) create mode 100644 changelog.d/feature.784e2262.entry.yaml diff --git a/AUTHORS.rst b/AUTHORS.rst index 498c6225..10f53c60 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -144,3 +144,4 @@ Contributors - Skyler Grey - Emil Velikov - Linnea Gräf +- Alex Railean diff --git a/changelog.d/feature.784e2262.entry.yaml b/changelog.d/feature.784e2262.entry.yaml new file mode 100644 index 00000000..23b9bbe8 --- /dev/null +++ b/changelog.d/feature.784e2262.entry.yaml @@ -0,0 +1,7 @@ +git_email: alexander.railean@siemens.com +git_user: Alex Railean +issue_id: null +message: Add support for RobotFramework +os_user: redacted +timestamp: 1731575694 +type: feature diff --git a/src/reuse/comment.py b/src/reuse/comment.py index d48e3bc4..b83e0372 100644 --- a/src/reuse/comment.py +++ b/src/reuse/comment.py @@ -18,6 +18,7 @@ # SPDX-FileCopyrightText: 2023 Shun Sakai # SPDX-FileCopyrightText: 2024 Rivos Inc. # SPDX-FileCopyrightText: 2024 Anthony Loiseau +# SPDX-FileCopyrightText: 2024 Alex Railean # # SPDX-License-Identifier: GPL-3.0-or-later @@ -508,6 +509,15 @@ class ReStructedTextCommentStyle(CommentStyle): INDENT_AFTER_SINGLE = " " +class RobotFrameworkCommentStyle(CommentStyle): + """RobotFramework comment style.""" + + SHORTHAND = "robot" + + SINGLE_LINE = "#" + INDENT_AFTER_SINGLE = " " + + class SemicolonCommentStyle(CommentStyle): """Semicolon comment style.""" @@ -764,6 +774,7 @@ class XQueryCommentStyle(CommentStyle): ".rbx": PythonCommentStyle, ".rkt": LispCommentStyle, ".Rmd": HtmlCommentStyle, + ".robot": RobotFrameworkCommentStyle, ".rs": CppCommentStyle, ".rss": HtmlCommentStyle, ".rst": ReStructedTextCommentStyle,