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

Add support to use args in tflint #92

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

msgongora
Copy link
Contributor

Description

While I was trying to disable some rules for tflint at specific locations I realized that I needed to use args because having a .tflint.hcl wasn't an option for my project structure. Here is the support for args.

$ tflint -v
TFLint version 0.44.1
+ ruleset.terraform (0.2.2-bundled)

$ tf version
Terraform v1.3.8
  - id: tflint
    name: Terraform lint (gcp project level)
    files: ^gcp/[\w_\-]+/[\w_\-]+\.tf$
    args: [--disable-rule=terraform_required_providers]

Documentation

TODOs

Please ensure all of these TODOs are completed before asking for a review.

  • Ensure the branch is named correctly with the issue number. e.g: feature/new-vpc-endpoints-955 or bug/missing-count-param-434.
  • Update the docs.
  • Keep the changes backward compatible where possible.
  • Run the pre-commit checks successfully.
  • Run the relevant tests successfully.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.

Related Issues

Not my initial issue but #90 should be fixed with this code.

gcagle3
gcagle3 previously approved these changes Apr 17, 2023
Copy link

@gcagle3 gcagle3 left a comment

Choose a reason for hiding this comment

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

Tested locally against tflint versions v0.39.3, v0.40.0, v0.43.0, v0.45.0, and v0.46.0. Confirming that this works as expected.

With the following, you can correctly use this change to pass a "--filter" argument to newer versions of tflint (v0.45.0+) to resolve the deprecation warning discussed in #90:

- id: tflint
  args: [--filter]

Change is backwards compatible with older versions of tflint.

j-collier
j-collier previously approved these changes Apr 18, 2023
Copy link

@j-collier j-collier left a comment

Choose a reason for hiding this comment

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

This works perfectly for me as well

@gcagle3
Copy link

gcagle3 commented Apr 20, 2023

@msgongora It looks like the build is failing because your fork is missing some updated pipeline changes from commit 5341f38. Could you rebase and pull in the latest changes into your fork? That should resolve the build failure and allow this to proceed.

@msgongora
Copy link
Contributor Author

@msgongora It looks like the build is failing because your fork is missing some updated pipeline changes from commit 5341f38. Could you rebase and pull in the latest changes into your fork? That should resolve the build failure and allow this to proceed.

Copy link

@gcagle3 gcagle3 left a comment

Choose a reason for hiding this comment

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

@msgongora thanks for the quick turnaround. Looks like the tests are passing now, so we can move forward with merging this. Thanks again for the great PR!

@gcagle3 gcagle3 merged commit 0c0c80e into gruntwork-io:master Apr 20, 2023
Stackclash referenced this pull request in Stackclash/home-cluster May 9, 2023
#863)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[gruntwork-io/pre-commit](https://togithub.com/gruntwork-io/pre-commit)
| repository | patch | `v0.1.18` -> `v0.1.21` |

Note: The `pre-commit` manager in Renovate is not supported by the
`pre-commit` maintainers or community. Please do not report any problems
there, instead [create a Discussion in the Renovate
repository](https://togithub.com/renovatebot/renovate/discussions/new)
if you have any questions.

---

### Release Notes

<details>
<summary>gruntwork-io/pre-commit</summary>

###
[`v0.1.21`](https://togithub.com/gruntwork-io/pre-commit/releases/tag/v0.1.21)

[Compare
Source](https://togithub.com/gruntwork-io/pre-commit/compare/v0.1.20...v0.1.21)

#### Modules affected

-   `tflint`

#### Description

- Add support to use args in tflint in
[https://github.com/gruntwork-io/pre-commit/pull/92](https://togithub.com/gruntwork-io/pre-commit/pull/92)

**Full Changelog**:
gruntwork-io/pre-commit@v0.1.20...v0.1.21

#### Special Thanks

- Special thanks to [@&#8203;msgongora](https://togithub.com/msgongora)
for their contribution!

###
[`v0.1.20`](https://togithub.com/gruntwork-io/pre-commit/releases/tag/v0.1.20)

[Compare
Source](https://togithub.com/gruntwork-io/pre-commit/compare/v0.1.19...v0.1.20)

#### Modules affected

-   `golangci-lint`

#### Description

- Add a `golangci-lint` hook by
[@&#8203;robmorgan](https://togithub.com/robmorgan) in
[https://github.com/gruntwork-io/pre-commit/pull/93](https://togithub.com/gruntwork-io/pre-commit/pull/93)

**Full Changelog**:
gruntwork-io/pre-commit@v0.1.19...v0.1.20

###
[`v0.1.19`](https://togithub.com/gruntwork-io/pre-commit/releases/tag/v0.1.19)

[Compare
Source](https://togithub.com/gruntwork-io/pre-commit/compare/v0.1.18...v0.1.19)

#### Modules affected

-   `sentinel-fmt`

#### Description

- Add sentinel fmt hook by
[@&#8203;thepoppingone](https://togithub.com/thepoppingone) in
[https://github.com/gruntwork-io/pre-commit/pull/89](https://togithub.com/gruntwork-io/pre-commit/pull/89)

#### Special thanks

- [@&#8203;thepoppingone](https://togithub.com/thepoppingone) made their
first contribution in
[https://github.com/gruntwork-io/pre-commit/pull/89](https://togithub.com/gruntwork-io/pre-commit/pull/89)

**Full Changelog**:
gruntwork-io/pre-commit@v0.1.18...v0.1.19

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on sunday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/RickCoxDev/home-cluster).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNjAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjU0LjAifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
joelbcastillo added a commit to Hyperfine/pre-commit that referenced this pull request Oct 25, 2023
* 'master' of ssh://github.com/gruntwork-io/pre-commit:
  [skip ci] Removing former Grunts (gruntwork-io#101)
  [skip ci] git-xargs programmatic commit (gruntwork-io#99)
  tflint has deprecated the 'tflint FILE/DIR' syntax (gruntwork-io#95)
  Add support to use args in tflint (gruntwork-io#92)
  Add a golangci-lint hook (gruntwork-io#93)
  Add sentinel fmt hook (gruntwork-io#89)
  Ignore hash links (gruntwork-io#86)
  Update CODEOWNERS (gruntwork-io#85)
  Update deprecated circleci images to latest (gruntwork-io#72)
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

Successfully merging this pull request may close these issues.

3 participants