diff --git a/AUTHORS.rst b/AUTHORS.rst index 3f40894ca..268addf25 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -66,6 +66,8 @@ Contributors - Shun Sakai +- Dirk Brömmel + Translators ----------- diff --git a/CHANGELOG.md b/CHANGELOG.md index 60fc8f647..e142f92f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ CLI command and its behaviour. There are no guarantees of stability for the - More file types are recognised: - Julia (`.jl`) (#815) + - Modern Fortran (`.f90`) (#836) ### Changed diff --git a/src/reuse/comment.py b/src/reuse/comment.py index 863e39327..dc5ddbf5a 100644 --- a/src/reuse/comment.py +++ b/src/reuse/comment.py @@ -14,6 +14,7 @@ # SPDX-FileCopyrightText: 2023 Kevin Meagher # SPDX-FileCopyrightText: 2023 Mathias Dannesbo # SPDX-FileCopyrightText: 2023 Shun Sakai +# SPDX-FileCopyrightText: 2023 Juelich Supercomputing Centre, Forschungszentrum Juelich GmbH # # SPDX-License-Identifier: GPL-3.0-or-later @@ -341,7 +342,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 +350,15 @@ 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 +572,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,