From f37cb40ad8a369cd1e4ffeac0bffa7ee91f7e55a Mon Sep 17 00:00:00 2001 From: Junjie Peng <657240269@qq.com> Date: Sat, 3 Mar 2018 15:22:51 +0800 Subject: [PATCH 1/2] Fix "Reindent" option for sqlformat. For sqlparse-0.2.3 and sqlparse-0.2.4, beautifying sql will throw "sqlformat: error: argument -r/--reindent: ignored explicit argument". --- CHANGELOG.md | 2 +- src/beautifiers/sqlformat.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86f39a6..79e4e06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Next -- ... +- Fix "Reindent" option for sqlformat. # v0.32.0 (2018-03-02) - See [#2026](https://github.com/Glavin001/atom-beautify/issues/2026) Add Vue support to ESLint Fixer beautifier. Should be used with [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue). diff --git a/src/beautifiers/sqlformat.coffee b/src/beautifiers/sqlformat.coffee index 02c5333..6f7ce19 100644 --- a/src/beautifiers/sqlformat.coffee +++ b/src/beautifiers/sqlformat.coffee @@ -17,7 +17,7 @@ module.exports = class Sqlformat extends Beautifier beautify: (text, language, options) -> @run("sqlformat", [ @tempFile("input", text) - "--reindent=#{options.reindent}" if options.reindent? + "--reindent" if (options.reindent? && options.reindent == true) "--indent_width=#{options.indent_size}" if options.indent_size? "--keywords=#{options.keywords}" if (options.keywords? && options.keywords != 'unchanged') "--identifiers=#{options.identifiers}" if (options.identifiers? && options.identifiers != 'unchanged') From e9f620736c7d4243e5a210d1ac0e217701b8117e Mon Sep 17 00:00:00 2001 From: Junjie Peng <657240269@qq.com> Date: Mon, 5 Mar 2018 09:48:25 +0800 Subject: [PATCH 2/2] Update sqlformat.coffee apply Glavin001's suggestion. --- src/beautifiers/sqlformat.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/beautifiers/sqlformat.coffee b/src/beautifiers/sqlformat.coffee index 6f7ce19..aa7ea71 100644 --- a/src/beautifiers/sqlformat.coffee +++ b/src/beautifiers/sqlformat.coffee @@ -17,7 +17,7 @@ module.exports = class Sqlformat extends Beautifier beautify: (text, language, options) -> @run("sqlformat", [ @tempFile("input", text) - "--reindent" if (options.reindent? && options.reindent == true) + "--reindent" if options.reindent is true "--indent_width=#{options.indent_size}" if options.indent_size? "--keywords=#{options.keywords}" if (options.keywords? && options.keywords != 'unchanged') "--identifiers=#{options.identifiers}" if (options.identifiers? && options.identifiers != 'unchanged')