Skip to content

Commit

Permalink
Add modern Fortran comment style
Browse files Browse the repository at this point in the history
  • Loading branch information
dbroemmel committed Oct 6, 2023
1 parent 8a94f52 commit 251c2a9
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/reuse/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,22 @@ def comment_at_first_character(cls, text: str) -> str:


class FortranCommentStyle(CommentStyle):
"""Fortran comment style."""
"""Fortran (fixed form) comment style."""

SHORTHAND = "f"

SINGLE_LINE = "c"
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."""

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 251c2a9

Please sign in to comment.