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
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
with:
|
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) {
|
switch fileExtension(base) {
|
||||||
case ".c", ".h", ".gv", ".java", ".scala", ".kt", ".kts":
|
case ".c", ".h", ".gv", ".java", ".scala", ".kt", ".kts":
|
||||||
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", ".ts":
|
||||||
lic, err = executeTemplate(tmpl, data, "/**", " * ", " */")
|
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":
|
||||||
lic, err = executeTemplate(tmpl, data, "", "// ", "")
|
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, "", "# ", "")
|
lic, err = executeTemplate(tmpl, data, "", "# ", "")
|
||||||
case ".el", ".lisp":
|
case ".el", ".lisp":
|
||||||
lic, err = executeTemplate(tmpl, data, "", ";; ", "")
|
lic, err = executeTemplate(tmpl, data, "", ";; ", "")
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ func TestLicenseHeader(t *testing.T) {
|
|||||||
"/*\n * HYS\n */\n\n",
|
"/*\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",
|
"/**\n * HYS\n */\n\n",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -316,7 +316,7 @@ func TestLicenseHeader(t *testing.T) {
|
|||||||
"// HYS\n\n",
|
"// 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",
|
"# HYS\n\n",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
28
testdata/expected/file.tf
vendored
28
testdata/expected/file.tf
vendored
@@ -1,17 +1,15 @@
|
|||||||
/**
|
# Copyright 2018 Google LLC
|
||||||
* Copyright 2018 Google LLC
|
#
|
||||||
*
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
# you may not use this file except in compliance with the License.
|
||||||
* you may not use this file except in compliance with the License.
|
# You may obtain a copy of the License at
|
||||||
* You may obtain a copy of the License at
|
#
|
||||||
*
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
#
|
||||||
*
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# See the License for the specific language governing permissions and
|
||||||
* See the License for the specific language governing permissions and
|
# limitations under the License.
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
resource "null_resource" "dummy" {}
|
resource "null_resource" "dummy" {}
|
||||||
|
|||||||
Reference in New Issue
Block a user