terraform-aws-modules / terraform-aws-ec2-instance

Terraform module to create AWS EC2 instance(s) resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/ec2-instance/aws
Apache License 2.0
758 stars 1.88k forks source link

Set repository shortname in .pre-commit-config.yaml #295

Closed tofupup closed 2 years ago

tofupup commented 2 years ago

Is your request related to a new offering from AWS?

No

Is your request related to a problem? Please describe.

When cloning the repository, and using the pre-commit-terraform docker container to run pre-commit checks, it requires modifying the .pre-commit-config.yaml file every clone/new branch to allow the wrappers/README.md to be properly generated. The module repo shortname is misdetected as lint if this is not set.

Describe the solution you'd like.

Modify .pre-commit-config.yaml to add the argument:

      - id: terraform_wrapper_module_for_each
        args:
          - '--args=--module-repo-shortname=ec2-instance'

Describe alternatives you've considered.

I submitted PR 431 to modify behavior of pre-commit-terraform to try to detect this itself, but it would be simpler to have this value set on cloning.

Additional context

This change should not impact people who don't use docker to run pre-commit, as the module repo shortname is valid regardless of running in the container or not.

This would break the situation where this repository was cloned to be used as the base for a new module. If the directory were renamed to the new module name, and the argument wasn't changed in .pre-commit-config.yaml, it would use ec2-instance still in the wrappers/README.md file. However, this seems a less likely scenario.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 2 years ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 2 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.