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.
[X] Ensure the branch is named correctly with the issue number. e.g: feature/new-vpc-endpoints-955 or bug/missing-count-param-434.
[X] Update the docs.
[X] Keep the changes backward compatible where possible.
[X] Run the pre-commit checks successfully.
[X] Run the relevant tests successfully.
[X] Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
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.
feature/new-vpc-endpoints-955
orbug/missing-count-param-434
.Related Issues
Fixes #102