From 251c2a97db445c40ca75551ae897e6a1d8c9b5b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20Br=C3=B6mmel?= Date: Fri, 6 Oct 2023 15:59:46 +0200 Subject: [PATCH] Add modern Fortran comment style --- src/reuse/comment.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/reuse/comment.py b/src/reuse/comment.py index 863e39327..e70c6aef5 100644 --- a/src/reuse/comment.py +++ b/src/reuse/comment.py @@ -341,7 +341,7 @@ def comment_at_first_character(cls, text: str) -> str: class FortranCommentStyle(CommentStyle): - """Fortran comment style.""" + """Fortran (fixed form) comment style.""" SHORTHAND = "f" @@ -349,6 +349,14 @@ class FortranCommentStyle(CommentStyle): INDENT_AFTER_SINGLE = " " +class ModernFortranCommentStyle(CommentStyle): + """Fortran (free form) comment style.""" + + SHORTHAND = "f90" + + SINGLE_LINE = "!" + INDENT_AFTER_SINGLE = " " + class FtlCommentStyle(CommentStyle): """FreeMarker Template Language comment style.""" @@ -562,15 +570,18 @@ class XQueryCommentStyle(CommentStyle): ".ex": PythonCommentStyle, ".exs": PythonCommentStyle, ".f": FortranCommentStyle, - ".f03": FortranCommentStyle, - ".f90": FortranCommentStyle, - ".f95": FortranCommentStyle, + ".f03": ModernFortranCommentStyle, + ".f08": ModernFortranCommentStyle, + ".f90": ModernFortranCommentStyle, + ".f95": ModernFortranCommentStyle, ".fish": PythonCommentStyle, ".fnl": LispCommentStyle, ".fodp": UncommentableCommentStyle, ".fods": UncommentableCommentStyle, ".fodt": UncommentableCommentStyle, ".for": FortranCommentStyle, + ".ftn": FortranCommentStyle, + ".fpp": FortranCommentStyle, ".fs": CCommentStyle, ".ftl": FtlCommentStyle, ".gemspec": PythonCommentStyle,