diff --git a/AUTHORS.rst b/AUTHORS.rst index 3f40894c..268addf2 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 defeed0e..aa22666f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ CLI command and its behaviour. There are no guarantees of stability for the - Declared support for Python 3.12. (#846) - 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 a450cc5d..aae60cb1 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 @@ -348,7 +349,7 @@ def comment_at_first_character(cls, text: str) -> str: class FortranCommentStyle(CommentStyle): - """Fortran comment style.""" + """Fortran (fixed form) comment style.""" SHORTHAND = "f" @@ -356,6 +357,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.""" @@ -569,15 +579,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,