2
main.go
2
main.go
@@ -262,7 +262,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
|
|||||||
lic, err = executeTemplate(tmpl, data, "/*", " * ", " */")
|
lic, err = executeTemplate(tmpl, data, "/*", " * ", " */")
|
||||||
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".tf", ".ts":
|
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".tf", ".ts":
|
||||||
lic, err = executeTemplate(tmpl, data, "/**", " * ", " */")
|
lic, err = executeTemplate(tmpl, data, "/**", " * ", " */")
|
||||||
case ".cc", ".cpp", ".cs", ".go", ".hh", ".hpp", ".java", ".m", ".mm", ".proto", ".rs", ".scala", ".swift", ".dart", ".groovy", ".kt", ".kts", ".v", ".sv":
|
case ".cc", ".cpp", ".cs", ".go", ".hcl", ".hh", ".hpp", ".java", ".m", ".mm", ".proto", ".rs", ".scala", ".swift", ".dart", ".groovy", ".kt", ".kts", ".v", ".sv":
|
||||||
lic, err = executeTemplate(tmpl, data, "", "// ", "")
|
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":
|
||||||
lic, err = executeTemplate(tmpl, data, "", "# ", "")
|
lic, err = executeTemplate(tmpl, data, "", "# ", "")
|
||||||
|
|||||||
@@ -309,7 +309,7 @@ func TestLicenseHeader(t *testing.T) {
|
|||||||
"/**\n * HYS\n */\n\n",
|
"/**\n * HYS\n */\n\n",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
[]string{"f.cc", "f.cpp", "f.cs", "f.go", "f.hh", "f.hpp", "f.java", "f.m", "f.mm", "f.proto",
|
[]string{"f.cc", "f.cpp", "f.cs", "f.go", "f.hcl", "f.hh", "f.hpp", "f.java", "f.m", "f.mm", "f.proto",
|
||||||
"f.rs", "f.scala", "f.swift", "f.dart", "f.groovy", "f.kt", "f.kts", "f.v", "f.sv", "f.php"},
|
"f.rs", "f.scala", "f.swift", "f.dart", "f.groovy", "f.kt", "f.kts", "f.v", "f.sv", "f.php"},
|
||||||
"// HYS\n\n",
|
"// HYS\n\n",
|
||||||
},
|
},
|
||||||
|
|||||||
22
testdata/expected/file.hcl
vendored
Normal file
22
testdata/expected/file.hcl
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
group "default" {
|
||||||
|
targets = ["build"]
|
||||||
|
}
|
||||||
|
|
||||||
|
target "build" {
|
||||||
|
dockerfile = "./Dockerfile"
|
||||||
|
output = ["type=docker"]
|
||||||
|
}
|
||||||
8
testdata/initial/file.hcl
vendored
Normal file
8
testdata/initial/file.hcl
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
group "default" {
|
||||||
|
targets = ["build"]
|
||||||
|
}
|
||||||
|
|
||||||
|
target "build" {
|
||||||
|
dockerfile = "./Dockerfile"
|
||||||
|
output = ["type=docker"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user