Skip to content

Commit

Permalink
Update copyright file template example + fix Makefile comment style
Browse files Browse the repository at this point in the history
  • Loading branch information
kosude committed Jun 4, 2024
1 parent ec6f381 commit 1eaa0b6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,15 @@ $(VSCODE_EXT_PREFIX)/node_modules:
vscode_ext: | validate_npm $(VSCODE_EXT_PREFIX)/node_modules
$(NPM) run $(VSCODE_EXT_NPM_SCRIPT) --prefix=$(VSCODE_EXT_PREFIX)

ifneq "$(DEBUG)" "1"
cp $(SRC_DIR)/LICENCE $(VSCODE_EXT_PREFIX)/LICENSE
cp $(SRC_DIR)/resources/icon.png $(VSCODE_EXT_DIST_DIR)/icon.png

cd $(VSCODE_EXT_PREFIX) && \
$(VSCE) $(VSCE_SUBCOMMAND) $(VSCE_FLAGS) $(subst v,,$(PROJECT_VERS_NO_COMMITN))
endif


#
# Remove build directory
# Remove build artifacts
#

clean:
Expand Down
8 changes: 8 additions & 0 deletions examples/templates/file/copyright
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
{%- set lang = lang_by_filename(filename=BUILTIN.file_name) -%}
{%- if lang != "unknown" -%}
{%- set com = comment_by_lang(lang_id=lang) -%}
{%- if com.0 | length <= 0 -%}
{{ com.1 }}
{%- else -%}
{{ com.0 }}
{%- endif %}
{{ com.1 }} Copyright (c) {{ year() }} {{ copyright_holders }}.
{{ com.1 }} All Rights Reserved.
{{ com.1 }}
{{ com.1 }} See the LICENCE file for more information.
{% if com.2 | length <= 0 -%}
{{ com.1 }}
{%- else -%}
{{ com.2 }}
{%- endif %}
{%- else -%}
Copyright (c) {{ year() }} {{ copyright_holders }}.
All Rights Reserved.
Expand Down
3 changes: 2 additions & 1 deletion src/templater/functions/language_specifics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ macro_rules! style {
}

/// An array of language id-comment style pairs.
const COMMENTS_BY_LANG_ID: [(&str, CommentStyle); 42] = [
const COMMENTS_BY_LANG_ID: [(&str, CommentStyle); 43] = [
style!("batch", ("", "REM", "")),
style!("c", ("/*", " *", " */")),
style!("clojure", ("", ";;", "")),
Expand All @@ -150,6 +150,7 @@ const COMMENTS_BY_LANG_ID: [(&str, CommentStyle); 42] = [
style!("kotlin", ("/*", " *", " */")),
style!("less", ("/*", " *", " */")),
style!("lua", ("", "--", "")),
style!("makefile", ("", "#", "")),
style!("markdown", ("", "", "")), // markdown doesn't really have comments
style!("perl", ("", "#", "")),
style!("python", ("", "#", "")),
Expand Down

0 comments on commit 1eaa0b6

Please sign in to comment.