Skip to content

Add "tflint" Hook #16

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

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Add "tflint" Hook #16

merged 1 commit into from
Jan 6, 2020

Conversation

Tensho
Copy link

@Tensho Tensho commented Dec 19, 2019

No description provided.

Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Same comment as the terraform validate PR.

Also, in the future, please split out commits for each PR so that the diff is not repeated across multiple PRs. If you need to build on older PRs, it is better to either hold off opening the PR, or open another PR against the original one. It makes it hard to review the actual changes when it is mixed with the other PR diffs.

hooks/tflint.sh Outdated
export PATH=$PATH:/usr/local/bin

for file in "$@"; do
tflint `dirname $file`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the terraform validate PR

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tflint can work with files and directories. IMHO, if the tool may work with files, we should leverage on the pre-commit's parallelization default.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. The only reason why I highlighted that was because you were using dirname.

@Tensho
Copy link
Author

Tensho commented Dec 20, 2019

@yorinasub17 Sorry for the inconvenience, you are totally right. I did this way because I had to refer to the overall changes in my project somehow. But it's kind of selfish, there is no excuse for me. I'll split them up carefully.

@yorinasub17
Copy link
Contributor

But it's kind of selfish, there is no excuse for me. I'll split them up carefully.

No worries! That was just a request.

I did this way because I had to refer to the overall changes in my project somehow.

The workflow I use is to commit each change set individually (using git add -p), then create branches for each change and use git cherry-pick. That way, I have a branch with everything, but also the split versions. For a small number of change sets, it works well. It can be tedious with lots of changes though.

@yorinasub17
Copy link
Contributor

Another approach is to work backwards:

  • Have a branch with all the commits
  • Create new branches for each change set to turn into PR from the combined branch
  • Use git rebase -i to drop the irrelevant commits from each subbranch.

@Tensho
Copy link
Author

Tensho commented Dec 21, 2019

@yorinasub17 Please let me know if I can do anything else 🙇

@yorinasub17
Copy link
Contributor

You'll need to resolve the conflict now that I merged the terraform-validate PR.

@Tensho
Copy link
Author

Tensho commented Dec 26, 2019

@yorinasub17 Resolved

@Tensho
Copy link
Author

Tensho commented Jan 6, 2020

@yorinasub17 Please let me know if I can do anything here 🙇

Copy link
Contributor

@yorinasub17 yorinasub17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay (we were out on vacation during the holiday weeks).

The updated changes LGTM so will be merging this.

@yorinasub17 yorinasub17 merged commit 5d5581f into gruntwork-io:master Jan 6, 2020
@Tensho
Copy link
Author

Tensho commented Jan 6, 2020

@yorinasub17 That's OK ⛄️ ❄️ 🏂 Thank you 🙇 Happy New Year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants