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

Terraform fmt on save #71

Closed
PeteGoo opened this Issue Feb 13, 2017 · 10 comments

Comments

Projects
None yet
6 participants
@PeteGoo
Copy link

PeteGoo commented Feb 13, 2017

It would be great to have the plugin run terraform fmt on saving of a file.

@stack72

This comment has been minimized.

Copy link

stack72 commented Feb 14, 2017

IMO that should be optional - the same way that Goglang has the ability so specify an action on save

@jen20

This comment has been minimized.

Copy link

jen20 commented Feb 14, 2017

Yup, the canonical terraform fmt style is particularly nasty, so making this optional would be a A Good Thing.

@matschaffer

This comment has been minimized.

Copy link

matschaffer commented Apr 12, 2017

For the time being I've worked around this with the file watchers plugin and the following config. Only been using it an hour or so, but seems to work okay so far.

screen shot 2017-04-12 at 9 25 00

@VladRassokhin VladRassokhin added this to the 0.7 milestone Sep 9, 2017

@VladRassokhin VladRassokhin reopened this Sep 18, 2017

@VladRassokhin

This comment has been minimized.

Copy link
Owner

VladRassokhin commented Sep 18, 2017

I've added separate action like it's done in Gogland.
There's no plan to automatically run 'terraform fmt' on save, though there's checkbox in commit dialog available which would run terraform fmt automatically on all changed files upon commit.

@danielcompton

This comment has been minimized.

Copy link

danielcompton commented Oct 21, 2017

Would you reconsider this? Gogland has an option to format on save: https://stackoverflow.com/a/42169265/826486. I personally find it much more useful to have format on save, as things are always formatted correctly. I don't use the IntelliJ VCS client, so the format on commit options there aren't so helpful.

@VladRassokhin

This comment has been minimized.

Copy link
Owner

VladRassokhin commented Oct 21, 2017

@danielcompton I'll think about that. If it's easy to do - will do. Anyway contributions are welcome.

@VladRassokhin VladRassokhin reopened this Oct 21, 2017

@VladRassokhin

This comment has been minimized.

Copy link
Owner

VladRassokhin commented Nov 15, 2017

@danielcompton Actually in latest GoLand EAP 18 they deprecated such feature... and migrated to pre-defined template for FileWatchers. Will investigate that.
goland eap 18 onsave

goland eap 18 filewatchers

goland eap 18 filewatcher config

@VladRassokhin

This comment has been minimized.

Copy link
Owner

VladRassokhin commented Nov 16, 2017

Fixed, now it's recommended to install 'File Watchers' plugin and configure one watcher configuration from terraform fmt template

@VladRassokhin VladRassokhin added this to the 0.6.9 milestone Nov 17, 2017

@VladRassokhin

This comment has been minimized.

Copy link
Owner

VladRassokhin commented Nov 17, 2017

FYI 0.6.9 with 'FileWatcher' template just released.

@matschaffer

This comment has been minimized.

Copy link

matschaffer commented Nov 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment