Open samparnell opened 5 years ago
Same for me on terraform 0.12
I have the same issue. Package version: 0.33.4 Atom version: 1.40.1 x64 OSX version: 10.13.6
Also failed beautifying my terraform code.
Severity Provider Description Line
[31m [1m[31mError: [0m[0m[1mOnly .tf and .tfvars files can be processed with terraform fmt[0m
[0m[0m[0m
[31m
[1m[31mError: [0m[0m[1mOnly .tf and .tfvars files can be processed with terraform fmt[0m
[0m[0m[0m
Hide Stack Trace
Error: [31m
[1m[31mError: [0m[0m[1mOnly .tf and .tfvars files can be processed with terraform fmt[0m
[0m[0m[0m
at /Users/username/.atom/packages/atom-beautify/src/beautifiers/executable.coffee:183:23
at tryCatcher (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:517:31)
at Promise._settlePromise (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:574:18)
at Promise._settlePromise0 (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:619:10)
at Promise._settlePromises (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/promise.js:699:18)
at _drainQueueStep (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:138:12)
at _drainQueue (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:147:5)
at Async.drainQueues (/Users/username/.atom/packages/atom-beautify/node_modules/bluebird/js/release/async.js:17:14)
at run (/Users/username/.atom/packages/git-plus/node_modules/core-js/modules/es6.promise.js:75:22)
at /Users/username/.atom/packages/git-plus/node_modules/core-js/modules/es6.promise.js:92:30
at flush (/Users/username/.atom/packages/git-plus/node_modules/core-js/modules/_microtask.js:18:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
+1
+1
+1
Is there any update on this to be fixed?
+1
+1
+1
+1
Is there any solution for this problem by now?
+1
Sounds like he may be working on another project.
I've switched to Visual Studio Code and will likely stay. Worth giving a go.
FWIW you can apply the fix from the PR yourself by editing %HOMEPATH%\.atom\packages\atom-beautify\src\beautifiers\terraformfmt.coffee
beautify: (text, language, options) ->
@exe("terraform").run([
"fmt"
- tempFile = @tempFile("input", text)
+ tempFile = @tempFile("input", text, ".tf")
])
Might I also highly recommend you add -no-color
to the args to make the lint messages more readable. (The garbage chars are from Terraform trying to add pretty shell colors)
beautify: (text, language, options) ->
@exe("terraform").run([
"fmt"
+ "-no-color"
tempFile = @tempFile("input", text, ".tf")
])
FWIW you can apply the fix from the PR yourself by editing
%HOMEPATH%\.atom\packages\atom-beautify\src\beautifiers\terraformfmt.coffee
beautify: (text, language, options) -> @exe("terraform").run([ "fmt" - tempFile = @tempFile("input", text) + tempFile = @tempFile("input", text, ".tf") ])
Both this and your "-no-color" tip worked great for me. Thanks. Maybe it's time to submit a PR.
@lmasaya It already is actually, just needs a merge https://github.com/Glavin001/atom-beautify/pull/2351/files
Minus the no-color flag, but somehow I think this project is abandoned now.
Description
Getting this error message when beautifying a .tf file: "Only .tf and .tfvars files can be processed with terraform fmt"
Happening for all my .tf files.
Steps to Reproduce
Atom Beautify: Beautify Editor
Package version: 0.33.4 Atom version: 1.37.0 OSX version: 10.14.5 Beatify on other file types seems to work fine.
Stack trace
Checklist
I have:
Atom Beautify: Help Debug Editor
command in Atom and added link fordebug.md
Gist to this issue