update terraform to use hash as comment per recommended guidelines (#137)
* update terraform to use hash as comment per recommended guidelines (https://developer.hashicorp.com/terraform/language/syntax/configuration\#comments) * update golanci-lint version in linter.yaml per PR #132
This commit is contained in:
2
.github/workflows/linter.yaml
vendored
2
.github/workflows/linter.yaml
vendored
@@ -18,4 +18,4 @@ jobs:
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.45
|
||||
version: v1.50.1
|
||||
|
||||
4
main.go
4
main.go
@@ -291,11 +291,11 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
|
||||
switch fileExtension(base) {
|
||||
case ".c", ".h", ".gv", ".java", ".scala", ".kt", ".kts":
|
||||
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", ".ts":
|
||||
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", "build":
|
||||
case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".tf", ".bzl", ".pl", ".pp", "build":
|
||||
lic, err = executeTemplate(tmpl, data, "", "# ", "")
|
||||
case ".el", ".lisp":
|
||||
lic, err = executeTemplate(tmpl, data, "", ";; ", "")
|
||||
|
||||
@@ -307,7 +307,7 @@ func TestLicenseHeader(t *testing.T) {
|
||||
"/*\n * HYS\n */\n\n",
|
||||
},
|
||||
{
|
||||
[]string{"f.js", "f.mjs", "f.cjs", "f.jsx", "f.tsx", "f.css", "f.scss", "f.sass", "f.tf", "f.ts"},
|
||||
[]string{"f.js", "f.mjs", "f.cjs", "f.jsx", "f.tsx", "f.css", "f.scss", "f.sass", "f.ts"},
|
||||
"/**\n * HYS\n */\n\n",
|
||||
},
|
||||
{
|
||||
@@ -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", "build"},
|
||||
[]string{"f.py", "f.sh", "f.yaml", "f.yml", "f.dockerfile", "dockerfile", "f.rb", "gemfile", "f.tcl", "f.tf", "f.bzl", "f.pl", "f.pp", "build"},
|
||||
"# HYS\n\n",
|
||||
},
|
||||
{
|
||||
|
||||
28
testdata/expected/file.tf
vendored
28
testdata/expected/file.tf
vendored
@@ -1,17 +1,15 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
# 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.
|
||||
|
||||
resource "null_resource" "dummy" {}
|
||||
|
||||
Reference in New Issue
Block a user