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

fix: Pass command line arguments to tflint init #487

Merged
merged 1 commit into from
Feb 3, 2023

Conversation

jmapro
Copy link
Contributor

@jmapro jmapro commented Feb 3, 2023

  • This PR introduces breaking change.
  • This PR fixes a bug.
  • This PR adds new functionality.
  • This PR enhances existing functionality.

Description of your changes

This PR fix a bug in tflint hook. Arguments are not passed to the init command. If your configuration is not a the root of your repository, tflint plugin are not downloaded and the hook fail.

How can we test changes

Create a file in .config/tflint.hcl with the following content

plugin "azurerm" {
  enabled = true
  source  = "github.com/terraform-linters/tflint-ruleset-azurerm"
  version = "0.20.0"
}

config {
  module = true
  force = false
  disabled_by_default = false

  varfile = ["terraform.tfvars"]
}

Add in your .pre-commit-config.yaml

      args:
        - --args=--config=__GIT_WORKING_DIR__/.config/tflint.hcl

@jmapro jmapro changed the title Pass command line arguments to tflint init fix: Pass command line arguments to tflint init Feb 3, 2023
@jmapro jmapro changed the title fix: Pass command line arguments to tflint init fix: pass command line arguments to tflint init Feb 3, 2023
@jmapro jmapro changed the title fix: pass command line arguments to tflint init fix: Pass command line arguments to tflint init Feb 3, 2023
Copy link
Collaborator

@MaxymVlasov MaxymVlasov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm bug. Fix works correctly, thank you

@MaxymVlasov MaxymVlasov added hook/terraform_tflint Bash hook bug_with_workaround Something isn't working but there is a workaround estimate/1h Need 1 hour to be done labels Feb 3, 2023
@antonbabenko antonbabenko merged commit 29a8c00 into antonbabenko:master Feb 3, 2023
antonbabenko pushed a commit that referenced this pull request Feb 3, 2023
## [1.77.1](v1.77.0...v1.77.1) (2023-02-03)

### Bug Fixes

* Pass command line arguments to tflint init ([#487](#487)) ([29a8c00](29a8c00))
@jmapro jmapro deleted the tflint-init branch February 3, 2023 15:46
@antonbabenko
Copy link
Owner

This PR is included in version 1.77.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug_with_workaround Something isn't working but there is a workaround estimate/1h Need 1 hour to be done hook/terraform_tflint Bash hook
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants