Open nim8562 opened 1 month ago
When I run sqlfluff-fix I get LT02-error and have my sql code changed from this. I use it via pre-commit hooks
INSERT INTO table (col1, col2, col3, col4) VALUES (1, 2, 3, 4) (5, 6, 7, 8)
to this
In documentation there is indentation for VALUES https://www.postgresql.org/docs/9.6/sql-insert.html I expected sqlfluff linter and fix not to fail on it or give opportunity to manage settings.
or
L: 13 | P: 1 | LT02 | Line should not be indented. [layout.indent]
Run sqlfluff lint or sqlfluff fix against this file
postgres
sqlfluff, version 3.0.5
[tool.sqlfluff.core] dialect = "postgres" exclude_rules = "L034" ignore = "templating" sql_file_exts = ".sql" max_line_length = 120
[tool.sqlfluff.indentation] indented_joins = false indented_using_on = true
[tool.sqlfluff.rules."layout.long_lines"] ignore_comment_clauses = true ignore_comment_lines = true
[tool.sqlfluff.rules."convention.count_rows"] prefer_count_1 = true
[tool.sqlfluff.rules."capitalisation.functions"] capitalisation_policy = "upper"
[tool.sqlfluff.rules."capitalisation.keywords"] capitalisation_policy = "upper"
[tool.sqlfluff.rules."capitalisation.literals"] capitalisation_policy = "upper"
[tool.sqlfluff.layout.type.column_constraint_segment] spacing_before = 'align' align_within = 'create_table_statement'
[tool.sqlfluff.layout.type.data_type] spacing_before = 'align' align_within = 'create_table_statement'
Search before asking
What Happened
When I run sqlfluff-fix I get LT02-error and have my sql code changed from this. I use it via pre-commit hooks
to this
Expected Behaviour
In documentation there is indentation for VALUES https://www.postgresql.org/docs/9.6/sql-insert.html I expected sqlfluff linter and fix not to fail on it or give opportunity to manage settings.
or
Observed Behaviour
L: 13 | P: 1 | LT02 | Line should not be indented. [layout.indent]
How to reproduce
Run sqlfluff lint or sqlfluff fix against this file
Dialect
postgres
Version
sqlfluff, version 3.0.5
Configuration
[tool.sqlfluff.core] dialect = "postgres" exclude_rules = "L034" ignore = "templating" sql_file_exts = ".sql" max_line_length = 120
[tool.sqlfluff.indentation] indented_joins = false indented_using_on = true
[tool.sqlfluff.rules."layout.long_lines"] ignore_comment_clauses = true ignore_comment_lines = true
[tool.sqlfluff.rules."convention.count_rows"] prefer_count_1 = true
[tool.sqlfluff.rules."capitalisation.functions"] capitalisation_policy = "upper"
[tool.sqlfluff.rules."capitalisation.keywords"] capitalisation_policy = "upper"
[tool.sqlfluff.rules."capitalisation.literals"] capitalisation_policy = "upper"
[tool.sqlfluff.layout.type.column_constraint_segment] spacing_before = 'align' align_within = 'create_table_statement'
[tool.sqlfluff.layout.type.data_type] spacing_before = 'align' align_within = 'create_table_statement'
Are you willing to work on and submit a PR to address the issue?
Code of Conduct