From 2d738328f46a7538585485da5c61e84c47b616ff Mon Sep 17 00:00:00 2001 From: Andy Fingerhut Date: Mon, 10 Mar 2025 14:19:28 -0400 Subject: [PATCH] Support for adding license to files whose name has suffix ".p4" Files whose names have the suffix '.p4" are typically written in the P4 programming language: https://p4.org Signed-off-by: Andy Fingerhut --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index b4cdd69..d87fb72 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 ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".ts": 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", ".p4": lic, err = executeTemplate(tmpl, data, "", "// ", "") case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".tf", ".bzl", ".pl", ".pp", "build", ".build", ".toml": lic, err = executeTemplate(tmpl, data, "", "# ", "")