-
-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tflint hook - please support home directory #165
Labels
hook/terraform_tflint
Bash hook
Comments
m00lecule
changed the title
tflint hook - support home directory
tflint hook - please support home directory
Feb 9, 2021
Try using |
$ git commit -m "test"
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 2
Failed to load TFLint config. An error occurred:
Error: `$HOME/.linters/.tflint.hcl` is not found But following cmd passed $ tflint --config=$HOME/.linters/.tflint.hcl @robinbowes I have also tried this approach, but it's not a correct answer |
#155 - probably this MR could solve it |
Bug is not comfirmed. 20:57 infra git:(master ⇣$+)
➜ ls -lah | grep .tflint
20:57 infra git:(master ⇣$+)
✘1 ➜ ls -lah ~ | grep .tflint
-rw-r--r-- 1 vm vm 63 Sep 9 20:55 .tflint.hcl
20:57 infra git:(master ⇣$+)
➜ cat ~/.tflint.hcl
rule "terraform_deprecated_interpolation" {
enabled = true
}
20:58 infra git:(master ⇣$!+)
➜ cat .pre-commit-config.yaml
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0
hooks:
- id: terraform_tflint
# args:
# - '--args=--config=__GIT_WORKING_DIR__/.tflint.hcl'
# args:
# - '--args=--config=/home/vm/.tflint.hcl'
20:58 infra git:(master ⇣$!+)
➜ pre-commit run -a terraform_tflint
Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 3
WARNING: The plugin `aws` is not explicitly enabled. The bundled plugin will be enabled instead, but it is deprecated and will be removed in a future version. Please see https://github.com/terraform-linters/tflint/pull/1160 for details.
2021-09-09T20:58:44.649+0300 [WARN] plugin: error closing client during Kill: err="unexpected EOF"
2021-09-09T20:58:44.649+0300 [WARN] plugin: plugin failed to exit gracefully
7 issue(s) found:
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on provider.tf line 8:
8: token = "${var.do_token}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 11:
11: user_data = "${file("config/webuserdata.sh")}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 19:
19: private_key = "${file("./pvt_key")}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 41:
41: droplet_id = "${digitalocean_droplet.elk-server.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 42:
42: volume_id = "${data.digitalocean_volume.elk-volume.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 48:
48: ip_address = "${var.public_ip}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 49:
49: droplet_id = "${digitalocean_droplet.elk-server.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
7 issue(s) found:
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on provider.tf line 8:
8: token = "${var.do_token}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 11:
11: user_data = "${file("config/webuserdata.sh")}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 19:
19: private_key = "${file("./pvt_key")}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 41:
41: droplet_id = "${digitalocean_droplet.elk-server.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 42:
42: volume_id = "${data.digitalocean_volume.elk-volume.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 48:
48: ip_address = "${var.public_ip}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 49:
49: droplet_id = "${digitalocean_droplet.elk-server.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
2021-09-09T20:58:42.411+0300 [WARN] plugin: error closing client during Kill: err="unexpected EOF"
2021-09-09T20:58:42.411+0300 [WARN] plugin: plugin failed to exit gracefully
7 issue(s) found:
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on provider.tf line 8:
8: token = "${var.do_token}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 11:
11: user_data = "${file("config/webuserdata.sh")}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 19:
19: private_key = "${file("./pvt_key")}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 41:
41: droplet_id = "${digitalocean_droplet.elk-server.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 42:
42: volume_id = "${data.digitalocean_volume.elk-volume.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 48:
48: ip_address = "${var.public_ip}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
on server.tf line 49:
49: droplet_id = "${digitalocean_droplet.elk-server.id}"
Reference: https://github.com/terraform-linters/tflint/blob/v0.31.0/docs/rules/terraform_deprecated_interpolation.md
2021-09-09T20:58:43.283+0300 [WARN] plugin: error closing client during Kill: err="unexpected EOF"
2021-09-09T20:58:43.283+0300 [WARN] plugin: plugin failed to exit gracefully
2021/09/09 20:58:45 [ERR] yamux: Failed to write header: write unix @->/tmp/plugin498167570: write: broken pipe
2021-09-09T20:58:44.081+0300 [WARN] plugin: error closing client during Kill: err="unexpected EOF"
2021-09-09T20:58:44.081+0300 [WARN] plugin: plugin failed to exit gracefully
20:58 infra git:(master ⇣$!+) took 11s
✘1 ➜ 20:59 infra git:(master ⇣$!+) took 8s
➜ cat ~/.tflint.hcl
rule "terraform_deprecated_interpolation" {
enabled = false
}
20:59 infra git:(master ⇣$!+)
➜ pre-commit run -a terraform_tflint
Terraform validate with tflint...........................................Passed
20:59 infra git:(master ⇣$!+) took 13s
➜ tflint -v
TFLint version 0.31.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello! Currently I am trying to figure out how to share one
.pre-commit-config.yml
among lots of repositories.I have tried downloading it to home directory and then referencing it using
~
. Unfortunately this approach is not working - following config:raises this exception:
For future reference this repo should be used by any user, then replacing
~
with the path/home/michal
is not acceptable. I would be pleased if this feature will be added in upcoming releases.The text was updated successfully, but these errors were encountered: