Added .pl to the list of supported files (#98)
* Added .pl to the list of supported files Includes support for Perl (.pl) file, treated in the same way as shell scripts. * Adding .pl to the relevant test case
This commit is contained in:
2
main.go
2
main.go
@@ -289,7 +289,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":
|
case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".bzl", ".pl":
|
||||||
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, "", ";; ", "")
|
||||||
|
|||||||
@@ -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"},
|
[]string{"f.py", "f.sh", "f.yaml", "f.yml", "f.dockerfile", "dockerfile", "f.rb", "gemfile", "f.tcl", "f.bzl", "f.pl"},
|
||||||
"# HYS\n\n",
|
"# HYS\n\n",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user