-
Notifications
You must be signed in to change notification settings - Fork 359
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 Request: Look for .tflint.hcl in repository root directory #1408
Comments
TFLint doesn't have awareness of version control or (Git) repositories. What I've proposed in the past that would address this use case is traversing upwards from the working directory until a file is encountered. Optionally, it could continue all the way up to |
Yes, that would be great. Although I would prefer that it stopped at the repository root and didn't continue outside of it to avoid some unpredictable situations (e.g. with Vagrant, a user could have settings in anywhere that would conflict with what the repository had defined -- I think the repository root should have the final say). |
Noted, but I'm telling you that coupling TFLint to one or more version control systems is a non-starter. TFLint operates at the level of Terraform modules. If you want to couple TFLint to tflint --config "$(git rev-parse --show-toplevel)/.tflint.hcl" Navigating upwards and merging allows you to ship an image (e.g. Docker, Vagrant box) that contains a set of defaults in Presumably setting |
I have a monorepo with many environments that share a Thanks for the suggestion, I'll add a alias to my shell configuration. I still think it'd be a better user experience if tflint would automatically do that, like other tools, but I understand the desire to have it independent from any version control. |
The walk up feature is definitely planned, this is a good reminder for me to pick it back up and get a PR up. Ultimately both that feature and composing with the Another idea here that you'd probably find appealing is adding |
Thanks for the root suggestion, that's indeed very nice. |
Currently, tflint looks for .tflint.hcl files in:
For monorepos with many environments, it would be useful if tflint would go to the repository root and use the
.tflint.hcl
from that location. This would allow projects to set repository-wide linting rules.The text was updated successfully, but these errors were encountered: