gruntwork-io / pre-commit

A collection of pre-commit hooks used by Gruntwork tools
https://gruntwork.io/
Apache License 2.0
484 stars 155 forks source link

Feature/add git root keyword 102 #103

Closed brycelowe closed 10 months ago

brycelowe commented 1 year ago

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.

Related Issues

Fixes #102