From 86e5288168dfdf62263b1a8e6d78d4493b456084 Mon Sep 17 00:00:00 2001 From: Caleb Albers Date: Mon, 1 Aug 2022 17:32:43 -0700 Subject: [PATCH] feat: add support for PowerShell files This encompasses all `.ps1` files, as well as module manifests and data files using `.psd1` and `.psm1` extensions. --- main.go | 2 +- main_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b2ef240..e9a892c 100644 --- a/main.go +++ b/main.go @@ -293,7 +293,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", ".pl", ".pp": + case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".bzl", ".pl", ".pp", ".ps1", ".psd1", ".psm1": lic, err = executeTemplate(tmpl, data, "", "# ", "") case ".el", ".lisp": lic, err = executeTemplate(tmpl, data, "", ";; ", "") diff --git a/main_test.go b/main_test.go index 9b0df64..c993505 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", "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", ".ps1", ".psd1", ".psm1"}, "# HYS\n\n", }, {