Skip to content

Commit cfe103d

Browse files
authored
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
1 parent 53d978a commit cfe103d

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

.github/workflows/linter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
- name: golangci-lint
1919
uses: golangci/golangci-lint-action@v3
2020
with:
21-
version: v1.45
21+
version: v1.50.1

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,11 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by
291291
switch fileExtension(base) {
292292
case ".c", ".h", ".gv", ".java", ".scala", ".kt", ".kts":
293293
lic, err = executeTemplate(tmpl, data, "/*", " * ", " */")
294-
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".tf", ".ts":
294+
case ".js", ".mjs", ".cjs", ".jsx", ".tsx", ".css", ".scss", ".sass", ".ts":
295295
lic, err = executeTemplate(tmpl, data, "/**", " * ", " */")
296296
case ".cc", ".cpp", ".cs", ".go", ".hcl", ".hh", ".hpp", ".m", ".mm", ".proto", ".rs", ".swift", ".dart", ".groovy", ".v", ".sv":
297297
lic, err = executeTemplate(tmpl, data, "", "// ", "")
298-
case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".bzl", ".pl", ".pp", "build":
298+
case ".py", ".sh", ".yaml", ".yml", ".dockerfile", "dockerfile", ".rb", "gemfile", ".tcl", ".tf", ".bzl", ".pl", ".pp", "build":
299299
lic, err = executeTemplate(tmpl, data, "", "# ", "")
300300
case ".el", ".lisp":
301301
lic, err = executeTemplate(tmpl, data, "", ";; ", "")

main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ func TestLicenseHeader(t *testing.T) {
307307
"/*\n * HYS\n */\n\n",
308308
},
309309
{
310-
[]string{"f.js", "f.mjs", "f.cjs", "f.jsx", "f.tsx", "f.css", "f.scss", "f.sass", "f.tf", "f.ts"},
310+
[]string{"f.js", "f.mjs", "f.cjs", "f.jsx", "f.tsx", "f.css", "f.scss", "f.sass", "f.ts"},
311311
"/**\n * HYS\n */\n\n",
312312
},
313313
{
@@ -316,7 +316,7 @@ func TestLicenseHeader(t *testing.T) {
316316
"// HYS\n\n",
317317
},
318318
{
319-
[]string{"f.py", "f.sh", "f.yaml", "f.yml", "f.dockerfile", "dockerfile", "f.rb", "gemfile", "f.tcl", "f.bzl", "f.pl", "f.pp", "build"},
319+
[]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"},
320320
"# HYS\n\n",
321321
},
322322
{

testdata/expected/file.tf

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
/**
2-
* Copyright 2018 Google LLC
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
1614

1715
resource "null_resource" "dummy" {}

0 commit comments

Comments
 (0)