From fc41b40a66af7acfe3f00527ab7f4da1aaa51bb8 Mon Sep 17 00:00:00 2001 From: Carlos Boneti Date: Wed, 27 Oct 2021 18:51:01 -0700 Subject: [PATCH] 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 --- main.go | 2 +- main_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 8bd07aa..e9ad11a 100644 --- a/main.go +++ b/main.go @@ -289,7 +289,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by lic, err = executeTemplate(tmpl, data, "/**", " * ", " */") case ".cc", ".cpp", ".cs", ".go", ".hcl", ".hh", ".hpp", ".m", ".mm", ".proto", ".rs", ".swift", ".dart", ".groovy", ".v", ".sv": 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, "", "# ", "") case ".el", ".lisp": lic, err = executeTemplate(tmpl, data, "", ";; ", "") diff --git a/main_test.go b/main_test.go index 76340db..0d63c72 100644 --- a/main_test.go +++ b/main_test.go @@ -316,7 +316,7 @@ func TestLicenseHeader(t *testing.T) { "// 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", }, {