File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export default {
111
111
112
112
// auto-formatting
113
113
if ( atom . config . get ( 'linter-terraform-syntax.useTerraformFormat' ) || atom . config . get ( 'linter-terraform-syntax.format.enabled' ) ) {
114
- const fmtArgs = [ 'fmt' , '-list=false' ] ;
114
+ const fmtArgs = [ 'fmt' , '-list=false' , '-no-color' ] ;
115
115
116
116
// recursive format if selected
117
117
if ( atom . config . get ( 'linter-terraform-syntax.recursiveFormat' ) || atom . config . get ( 'linter-terraform-syntax.format.recursive' ) )
@@ -122,7 +122,16 @@ export default {
122
122
fmtArgs . push ( editorFile ) ;
123
123
124
124
// auto-format the target
125
- helpers . exec ( atom . config . get ( 'linter-terraform-syntax.terraformExecutablePath' ) , fmtArgs , { cwd : dir } ) ;
125
+ helpers . exec ( atom . config . get ( 'linter-terraform-syntax.terraformExecutablePath' ) , fmtArgs , { cwd : dir } ) . catch ( error => {
126
+ // catch format errors and display as pulsar warning
127
+ atom . notifications . addWarning (
128
+ 'An error occurred during automatic formatting.' ,
129
+ {
130
+ detail : error . message ,
131
+ dismissable : true
132
+ }
133
+ ) ;
134
+ } ) ;
126
135
}
127
136
128
137
// execute the linting
You can’t perform that action at this time.
0 commit comments