Skip to content
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

terraform_lint doesn't correctly parse args #93

Closed
grabcocque opened this issue Feb 20, 2020 · 5 comments
Closed

terraform_lint doesn't correctly parse args #93

grabcocque opened this issue Feb 20, 2020 · 5 comments

Comments

@grabcocque
Copy link
Contributor

grabcocque commented Feb 20, 2020

I've added the following to my pre-commit config:

repos:
  - repo: git://github.com/antonbabenko/pre-commit-terraform
    rev: v1.25.0
    hooks:
      - id: terraform_fmt
      - id: terraform_validate
      - id: terraform_tflint
        args: ['--deep']

but:

$ pre-commit run -a
Terraform fmt............................................................Passed
Terraform validate without variables.....................................Passed
Terraform validate with tflint...........................................Failed
- hook id: terraform_tflint
- exit code: 1

getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
getopt: unrecognized option '--deep'
@barryib
Copy link
Contributor

barryib commented Feb 20, 2020

Did you try something like this :

      - id: terraform_tflint
        args: ['args=--deep']

@pietro
Copy link

pietro commented Feb 27, 2020

      - id: terraform_tflint
        args: ['args=--deep']

works. In order to pass multiple args I had do add args= to every arg like:

      - id: terraform_tflint
        args:
          - 'args=--deep'
          - 'args=--enable-rule=terraform_documented_variables'

@barryib
Copy link
Contributor

barryib commented Feb 27, 2020

Great. @pietro or @grabcocque will you please update the doc ?

@grabcocque
Copy link
Contributor Author

I've opened a PR: #95

@antonbabenko
Copy link
Owner

v1.27.0 has been just released.

Thanks @grabcocque !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants