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

Feature/add git root keyword 102 #103

Merged

Conversation

brycelowe
Copy link
Contributor

Description

When operating in a monorepo the new functionality of tflint (--chdir) breaks config file path by changing the current working directory when tflint runs. This commit patches this gap by allowing a user to provide GIT_ROOT or populate a environment variable with a custom string and when the --config argument is is found it replaces that keyword with the repository root (pwd in the case of pre-commit).

I've also re-positioned the init call and passed the arguments to it as it simply looked for the default .tflint.hcl.

Documentation

I've updated the README.md with the caveats that this introduces and how to use it.

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

Fixes #102

When operating in a monorepo the new functionality of tflint (`--chdir`) breaks config file path by changing the current working directory when tflint runs.  This commit patches this gap by allowing a user to provide __GIT_ROOT__ or populate a environment variable with a custom string and when the `--config` argument is is found it replaces that keyword with the repository root (pwd in the case of pre-commit).
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.

This is a great addition!

@gcagle3 gcagle3 merged commit d0bcdb3 into gruntwork-io:master Nov 7, 2023
2 checks passed
@brycelowe brycelowe deleted the feature/add-git-root-keyword-102 branch March 15, 2024 01:27
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.

.tflint.hcl is rules are ignored
2 participants