reviewdog / action-tflint

Run tflint with reviewdog on pull requests to enforce best practices
MIT License
107 stars 22 forks source link

Feature request: ability to specify the tflint version to use #32

Closed longnd closed 3 years ago

longnd commented 3 years ago

According to TFLint documentation, each TFLint version uses a specific Terraform version to do the linting - usually the latest Terraform version. But the written Terraform code isn't always that version, thus we have to use the right Tflint version to check.

TFLint works as a single binary because Terraform is embedded as a library. Note that this means that the version of Terraform used is determined for each TFLint version. TFLint loads files differently than the installed Terraform, so an error can occur if the version of Terraform supported by TFLint is different from the installed Terraform.

This action always installs the latest Tflint version so false positives/negatives can occur. Please support the ability to specify the expected TFLint version to use.

Vlaaaaaaad commented 3 years ago

Hm... I think we might be able to have variables for the reviewdog and tflint that are automatically updated by action-depup or an automated tool.

I'll do some experiments and see how I can implement this!

Vlaaaaaaad commented 3 years ago

@longnd https://github.com/reviewdog/action-tflint/pull/34 is adding this feature 🙂 I tested it and you can also see in this run on the PR that a custom version is indeed used!

I'll leave the PR open a little while for reviews, but I fully expect it to be merged by the end of next week.