diff --git a/main.go b/main.go index f80a74f..1e4bbb7 100644 --- a/main.go +++ b/main.go @@ -295,7 +295,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", ".tf", ".bzl", ".pl", ".pp", "build": + case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".tf", ".bzl", ".pl", ".pp", "build", ".toml": lic, err = executeTemplate(tmpl, data, "", "# ", "") case ".el", ".lisp": lic, err = executeTemplate(tmpl, data, "", ";; ", "") diff --git a/testdata/expected/file.toml b/testdata/expected/file.toml new file mode 100644 index 0000000..28eec5e --- /dev/null +++ b/testdata/expected/file.toml @@ -0,0 +1,16 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[package] +name = "not-a-real-crate" diff --git a/testdata/initial/file.toml b/testdata/initial/file.toml new file mode 100644 index 0000000..af1c55b --- /dev/null +++ b/testdata/initial/file.toml @@ -0,0 +1,2 @@ +[package] +name = "not-a-real-crate"