diff --git a/main.go b/main.go index 0263907..bf53861 100644 --- a/main.go +++ b/main.go @@ -306,6 +306,11 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by lic, err = executeTemplate(tmpl, data, "", "// ", "") case ".ml", ".mli", ".mll", ".mly": lic, err = executeTemplate(tmpl, data, "(**", " ", "*)") + default: + // handle various cmake files + if base == "cmakelists.txt" || strings.HasSuffix(base, ".cmake.in") || strings.HasSuffix(base, ".cmake") { + lic, err = executeTemplate(tmpl, data, "", "# ", "") + } } return lic, err } diff --git a/main_test.go b/main_test.go index 0d63c72..0c60953 100644 --- a/main_test.go +++ b/main_test.go @@ -339,6 +339,16 @@ func TestLicenseHeader(t *testing.T) { []string{"f.ml", "f.mli", "f.mll", "f.mly"}, "(**\n HYS\n*)\n\n", }, + { + []string{"cmakelists.txt", "f.cmake", "f.cmake.in"}, + "# HYS\n\n", + }, + + // ensure matches are case insenstive + { + []string{"F.PY", "DoCkErFiLe"}, + "# HYS\n\n", + }, } for _, tt := range tests {