Skip to content
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] add source generator meta to generated comment #1661

Closed
delconis opened this issue Apr 24, 2024 · 2 comments
Closed

[FEATURE] add source generator meta to generated comment #1661

delconis opened this issue Apr 24, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@delconis
Copy link

delconis commented Apr 24, 2024

Is your feature request related to a problem? Please describe.
When reviewing generated code, it's hard to determine which parent stack generated the item

Describe the solution you'd like
I would like to see the current generated message
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT

To include the invoking generator that created it.
// TERRAMATE: "dev/app/stack.tm.hcl" GENERATED AUTOMATICALLY DO NOT EDIT

Describe alternatives you've considered
Some alternatives would be a way to list all the generated files in a given stack via cli terramate generate --list --chdir dev/app where the output might look like, and list would force and output for each generated item in the stack regardless if there is a modification.

Code generation report

Successes:

[ ] /dev/app
  [ ] provider.tf - Generated from (dev/stack.tm.hcl)
  [ ] backend.tf - Generated from (dev/app/stack.tm.hcl)
@delconis delconis added the enhancement New feature or request label Apr 24, 2024
@i4ki
Copy link
Contributor

i4ki commented Apr 25, 2024

Hi @delconis

Have you tried the terramate debug show generate-origins?
For each generated file, it shows the file and line/column where it comes from.

Let me know if it helps you.

Fun fact: Terramate used to include the file name in the header but it caused too many stacks being triggered for changes (when using tm run --changed ...) whenever someone refactored the generated file names. See here the PR that removed it: #710

@mariux
Copy link
Contributor

mariux commented May 17, 2024

closing as we have a command to get the information, please reopen when needed.

@mariux mariux closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants