diff --git a/CHANGELOG.md b/CHANGELOG.md index ad1c845..7674147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ -### (Next) +### 1.6.3 (Next) +- Warn on automatic formatting errors returned for non-config Terraform files. ### 1.6.2 - Refactor auto formatting config options. diff --git a/lib/main.js b/lib/main.js index 99d04ed..f34f274 100644 --- a/lib/main.js +++ b/lib/main.js @@ -123,14 +123,17 @@ export default { // auto-format the target helpers.exec(atom.config.get('linter-terraform-syntax.terraformExecutablePath'), fmtArgs, { cwd: dir }).catch(error => { - // catch format errors and display as pulsar warning - atom.notifications.addWarning( - 'An error occurred during automatic formatting.', - { - detail: error.message, - dismissable: true - } - ); + // verify this is not a config file since validate returns for those files + if (!(/\.tf$/.exec(editorFile))) { + // catch format errors and display as pulsar warning + atom.notifications.addWarning( + 'An error occurred during automatic formatting.', + { + detail: error.message, + dismissable: true + } + ); + } }); }