Merge pull request '[DO-467] fixed extensions' (#5) from feature/DO-467--add-check-license into master
Some checks failed
linter / lint (1.x, ubuntu-latest) (push) Has been cancelled
tests / test (1.16.x, ubuntu-latest) (push) Has been cancelled
tests / test (1.x, ubuntu-latest, true) (push) Has been cancelled

Reviewed-on: https://git.avroid.tech/Tools/Addlicense/pulls/5
This commit is contained in:
Aleksandr Vodyanov
2024-05-22 17:23:40 +03:00

View File

@@ -302,7 +302,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
lic, err = executeTemplate(tmpl, data, "/**", " * ", " */") lic, err = executeTemplate(tmpl, data, "/**", " * ", " */")
case ".cc", ".cpp", ".cs", ".go", ".hcl", ".hh", ".hpp", ".m", ".mm", ".proto", ".rs", ".swift", ".dart", ".groovy", ".v", ".sv": case ".cc", ".cpp", ".cs", ".go", ".hcl", ".hh", ".hpp", ".m", ".mm", ".proto", ".rs", ".swift", ".dart", ".groovy", ".v", ".sv":
lic, err = executeTemplate(tmpl, data, "", "// ", "") lic, err = executeTemplate(tmpl, data, "", "// ", "")
case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".tf", ".bzl", ".pl", ".pp", "build", ".build", ".toml": case ".py", ".sh", ".yaml", ".yml", ".dockerfile", ".rb", "gemfile", ".tcl", ".tf", ".bzl", ".pl", ".pp", "build", ".build", ".toml":
lic, err = executeTemplate(tmpl, data, "", "# ", "") lic, err = executeTemplate(tmpl, data, "", "# ", "")
case ".el", ".lisp": case ".el", ".lisp":
lic, err = executeTemplate(tmpl, data, "", ";; ", "") lic, err = executeTemplate(tmpl, data, "", ";; ", "")
@@ -328,7 +328,10 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
if base == "cmakelists.txt" || strings.HasSuffix(base, ".cmake.in") || strings.HasSuffix(base, ".cmake") { if base == "cmakelists.txt" || strings.HasSuffix(base, ".cmake.in") || strings.HasSuffix(base, ".cmake") {
lic, err = executeTemplate(tmpl, data, "", "# ", "") lic, err = executeTemplate(tmpl, data, "", "# ", "")
} }
if base == "Jenkinsfile" || strings.HasSuffix(base, ".groovy") { if base == "jenkinsfile" || strings.HasSuffix(base, ".groovy") {
lic, err = executeTemplate(tmpl, data, "", "// ", "")
}
if base == "dockerfile" || strings.HasSuffix(base, ".dockerfile") {
lic, err = executeTemplate(tmpl, data, "", "// ", "") lic, err = executeTemplate(tmpl, data, "", "// ", "")
} }
} }