Rule proposal: enforce depth for modules from Git #256
chernetskyi
started this conversation in
Ideas
Replies: 1 comment
-
Interesting, I was also unaware as I've moved on from sourcing modules from git directly. We generally look for recommendations from the Terraform docs for rules in this ruleset, and this meets that criteria. So 👍🏻 to a rule PR. I'd say it should not be enabled by default given that Terraform positions it as a feature "you may prefer to" enable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Terraform allows to shallow clone the repositories with the modules:
https://developer.hashicorp.com/terraform/language/modules/sources#shallow-clone
Somehow, this feature is not well-known (no one I asked knew about it), but is very beneficial. My team only uses modules with GitHub sources and this small change notably decreased the durations of
terraform init
. I believe a rule enforcingdepth=1
will benefit not only my team. Documentation's wording looks like a recommendation:I can implement the rule if maintainers agree there is a place for it in this repository.
Regarding the details, I think the rule should be enabled by default and trigger for Git (GitHub, BitBucket) module sources that do not specify raw commit IDs in the
ref
argument.Beta Was this translation helpful? Give feedback.
All reactions