diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2017-11-24 11:52:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-24 11:52:36 +0100 |
| commit | 4e44545cb759a7b321d85009e7258385fae71740 (patch) | |
| tree | e9f1b99e47b2379975bac895b95d26d7e90b6112 /sqlparse/formatter.py | |
| parent | ec1c5b189bdc6f1673eeebe3b12958ca5d527fa3 (diff) | |
| parent | 8f5003bc8d06fc5b3167eb2a1bd24cc1fb399fa4 (diff) | |
| download | sqlparse-4e44545cb759a7b321d85009e7258385fae71740.tar.gz | |
Merge pull request #345 from johshoff/master
Option to indent after first line
Diffstat (limited to 'sqlparse/formatter.py')
| -rw-r--r-- | sqlparse/formatter.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sqlparse/formatter.py b/sqlparse/formatter.py index a58d5af..b36fe56 100644 --- a/sqlparse/formatter.py +++ b/sqlparse/formatter.py @@ -70,6 +70,11 @@ def validate_options(options): elif reindent_aligned: options['strip_whitespace'] = True + indent_after_first = options.get('indent_after_first', False) + if indent_after_first not in [True, False]: + raise SQLParseError('Invalid value for indent_after_first: ' + '{0!r}'.format(indent_after_first)) + indent_tabs = options.get('indent_tabs', False) if indent_tabs not in [True, False]: raise SQLParseError('Invalid value for indent_tabs: ' @@ -153,6 +158,7 @@ def build_filter_stack(stack, options): stack.stmtprocess.append( filters.ReindentFilter(char=options['indent_char'], width=options['indent_width'], + indent_after_first=options['indent_after_first'], wrap_after=options['wrap_after'], comma_first=options['comma_first'])) |
