Add option for sqlformat to re-indent

This commit is contained in:
Faheel Ahmad 2017-11-03 20:11:32 +05:30
parent 78db075f83
commit 93aae32f8c
2 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,7 @@ module.exports = class Sqlformat extends Beautifier
beautify: (text, language, options) ->
@run("sqlformat", [
@tempFile("input", text)
"--reindent"
"--reindent=#{options.reindent}" if options.reindent?
"--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')

View File

@ -26,6 +26,10 @@ module.exports = {
default: null
minimum: 0
description: "Indentation size/length"
reindent:
type: 'boolean'
default: true
description: "Change indentations of the statements. Uncheck this option to preserve indentation"
keywords:
type: 'string'
default: "upper"