Skip to content

Commit

Permalink
Merge pull request #889 from perillo/add-zig-support
Browse files Browse the repository at this point in the history
Add support for Zig and fix Hare comment style
  • Loading branch information
carmenbianca authored Jan 16, 2024
2 parents cbca4a7 + 4e8e0c5 commit 252d619
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ CLI command and its behaviour. There are no guarantees of stability for the
- ShellCheck configuration (`.shellcheckrc`) (#862)
- Pylint in-project configuration (`pylintrc`) (#862)
- Lisp schemes (`.sld`, `.sls`, `.sps`) (#875)
- Added comment styles:
- `csingle` for Zig (`.zig`) and Hare (`.ha`) (#889)
- Display recommendations for steps to fix found issues during a lint. (#698)
- Add support for Pijul VCS. Pijul support is not added to the Docker image.
(#858)
Expand Down
18 changes: 14 additions & 4 deletions src/reuse/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,15 @@ class XQueryCommentStyle(CommentStyle):
INDENT_BEFORE_END = " "


class CSingleCommentStyle(CommentStyle):
"""C single-only comment style."""

SHORTHAND = "csingle"

SINGLE_LINE = "//"
INDENT_AFTER_SINGLE = " "


#: A map of (common) file extensions against comment types.
EXTENSION_COMMENT_STYLE_MAP = {
".adb": HaskellCommentStyle,
Expand Down Expand Up @@ -600,7 +609,7 @@ class XQueryCommentStyle(CommentStyle):
".graphql": PythonCommentStyle,
".groovy": CCommentStyle,
".h": CCommentStyle,
".ha": CCommentStyle,
".ha": CSingleCommentStyle,
".hbs": HandlebarsCommentStyle,
".hcl": PythonCommentStyle,
".hh": CCommentStyle,
Expand Down Expand Up @@ -712,11 +721,11 @@ class XQueryCommentStyle(CommentStyle):
# SuperCollider synth definition (binary)
".scsyndef": UncommentableCommentStyle,
".sh": PythonCommentStyle,
".sld": LispCommentStyle, # Scheme Library Definition (R7RS)
".sls": LispCommentStyle, # Scheme Library Source (R6RS)
".sld": LispCommentStyle, # Scheme Library Definition (R7RS)
".sls": LispCommentStyle, # Scheme Library Source (R6RS)
".sml": MlCommentStyle,
".soy": CCommentStyle,
".sps": LispCommentStyle, # Scheme Program Source (R6RS)
".sps": LispCommentStyle, # Scheme Program Source (R6RS)
".sql": HaskellCommentStyle,
".sty": TexCommentStyle,
".svg": UncommentableCommentStyle,
Expand Down Expand Up @@ -756,6 +765,7 @@ class XQueryCommentStyle(CommentStyle):
".xsl": HtmlCommentStyle,
".yaml": PythonCommentStyle,
".yml": PythonCommentStyle,
".zig": CSingleCommentStyle,
".zsh": PythonCommentStyle,
}

Expand Down

0 comments on commit 252d619

Please sign in to comment.