Add support for bazel BUILD files

This commit is contained in:
Omkar Ghanekar
2022-10-10 20:53:18 +00:00
committed by Will Norris
parent 04bfe4ee9c
commit 53d978ad7e
2 changed files with 2 additions and 2 deletions

View File

@@ -295,7 +295,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", ".bzl", ".pl", ".pp": case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".bzl", ".pl", ".pp", "build":
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, "", ";; ", "")

View File

@@ -316,7 +316,7 @@ func TestLicenseHeader(t *testing.T) {
"// HYS\n\n", "// HYS\n\n",
}, },
{ {
[]string{"f.py", "f.sh", "f.yaml", "f.yml", "f.dockerfile", "dockerfile", "f.rb", "gemfile", "f.tcl", "f.bzl", "f.pl", "f.pp"}, []string{"f.py", "f.sh", "f.yaml", "f.yml", "f.dockerfile", "dockerfile", "f.rb", "gemfile", "f.tcl", "f.bzl", "f.pl", "f.pp", "build"},
"# HYS\n\n", "# HYS\n\n",
}, },
{ {