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

Added very basic terraform fmt runner #6

Merged
merged 4 commits into from
Jan 5, 2017

Conversation

madssj
Copy link
Contributor

@madssj madssj commented Jan 5, 2017

I added a configuration option for terraform.formatOnSave and a little function running terraform fmt - with the input from the document.

  • Make path to terraform configurable
  • Something is broken in the way the content is updated, see the go plugin for inspiration
  • Squash commits

Thoughts?

Copy link
Contributor

@mauve mauve left a comment

Choose a reason for hiding this comment

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

Really cool, thanks. Before I merge could you please squash "Add initial code plugin." and "Added very basic terraform formatting" ?

Also it would be awesome if the path to terraform could be made configurable, but that is just "would-be-cool"-type of comment so no need to fix.


function fmt(text: string): Promise<string> {
return new Promise<string>((resolve, reject) => {
const child = exec('terraform fmt -', {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make the path to terraform configurable?

@madssj
Copy link
Contributor Author

madssj commented Jan 5, 2017

@mauve that should do it.

@madssj madssj changed the title WIP: Added very basic terraform fmt runner Added very basic terraform fmt runner Jan 5, 2017
@mauve mauve merged commit 493591b into hashicorp:master Jan 5, 2017
@madssj madssj deleted the feature/add-terraform-fmt branch January 5, 2017 15:23
@mauve
Copy link
Contributor

mauve commented Jan 5, 2017

thanks for your contributions, I will push a new release to the vscode gallery later tonight after writing some changelog, do you mind if I mention you in the releasenotes?

@jjmartin
Copy link

the formatOnSave is kinda bad when you have Auto-Save on

is there a hook into editor.action.formatDocument that this could be executed on?

aeschright added a commit that referenced this pull request May 29, 2020
@ghost ghost locked and limited conversation to collaborators Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants