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-request] terraspace fmt specific files #95

Open
ellisio opened this issue Mar 24, 2021 · 2 comments · Fixed by #96
Open

[feature-request] terraspace fmt specific files #95

ellisio opened this issue Mar 24, 2021 · 2 comments · Fixed by #96
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ellisio
Copy link

ellisio commented Mar 24, 2021

Summary

In #94, terraspace fmt was added (🥳 ). Can this be further expanded upon to pass a list of files to run fmt on, instead of the entire project? Something like this:

terraspace fmt stacks/project/main.tf stacks/gke/main.tf

Motivation

We are using a .pre-commit-config.yaml to run certain things as a pre-commit hook to the project. We've added this into the mix to ensure our files are formatted. However, if we change one file, it runs on the entire project resulting in a long processing of our larger Terraspace projects.

If we could pass individual files, pre-commit-config allows us to pass the staged files to the script being called. This would drastically improve pre-commit performance as it would only need to run on the files that were actually modified.

Note: I would submit a PR, but I am not familiar enough with Ruby and am hoping someone else has some bandwidth to cook this up. 🍻

@ellisio ellisio changed the title terraspace fmt specific files [feature-request] terraspace fmt specific files Mar 24, 2021
@tongueroo tongueroo added good first issue Good for newcomers help wanted Extra attention is needed labels Mar 24, 2021
@tongueroo tongueroo reopened this Mar 24, 2021
@tongueroo
Copy link
Contributor

Did a quick simple implementation that adds the ability to specify the module or stack name for now in #96

Think it can be improved as shown in the request:

terraspace fmt stacks/project/main.tf stacks/gke/main.tf

Will consider PRs to improve this. Of course, no sweat either way 👍 Otherwise, will dig into it in time ⏰

@tongueroo tongueroo added the enhancement New feature or request label Mar 24, 2021
@ellisio
Copy link
Author

ellisio commented Mar 24, 2021

@tongueroo I'll see if I can take a stab at it over the weekend when the kids are napping. Be ready to see some bad Ruby code though. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants