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

terraform fmt support #82

Merged
merged 2 commits into from
Sep 21, 2020
Merged

terraform fmt support #82

merged 2 commits into from
Sep 21, 2020

Conversation

paultyng
Copy link
Contributor

@paultyng paultyng commented Sep 11, 2020

Added 3 functions for formatting support

  • FormatString for formatting a single string, operates terraform fmt in stdin mode
  • FormatCheck calls terraform fmt -check in the working directory, or selected directory, and returns true if the files were already formatted, no files will be written.
  • FormatWrite calls terraform fmt in the working directory, or selected directory, files will be written.

@paultyng paultyng added the enhancement New feature or request label Sep 11, 2020
tfexec/errors.go Outdated
if _, ok := err.(*exec.ExitError); !ok {
// if not an ExitError, just return it, do not try to parse
var ee *exec.ExitError
if !errors.As(err, &ee) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should probably do this manually to support 0.12 compilation (if not testing)

tfexec/errors.go Outdated Show resolved Hide resolved
@appilon
Copy link
Contributor

appilon commented Sep 16, 2020

closing was misclick..

@appilon appilon marked this pull request as ready for review September 16, 2020 01:25
@appilon appilon merged commit d11be91 into master Sep 21, 2020
@appilon appilon deleted the fmt branch September 21, 2020 16:27
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

Successfully merging this pull request may close these issues.

3 participants