diffplug / spotless

Keep your code spotless
Apache License 2.0
4.34k stars 441 forks source link

SQL query formatting issue. Hyphen enclosed in string treated as minus #1133

Open snrssc opened 2 years ago

snrssc commented 2 years ago

If you are submitting a bug, please include the following:

If you're just submitting a feature request or question, no need for the above.

nedtwigg commented 2 years ago

Happy to take a bugfix PR. It would help to have a concrete example with:

snrssc commented 2 years ago

@nedtwigg Thanks for response. Following are the examples,

Input insert into dbname.employee-salary values(1,20,"abc");

Expected Output:

INSERT INTO dbname.employee-salary VALUES( 1, 20, "abc" )

Actual output: (Please see a space added in table name)

INSERT INTO dbname.employee - salary VALUES( 1, 20, "abc" );

Additional info :

Maven configuration -

data_pipelines/customer_dimension/dags/sql/test.sql dbeaver.properties

dbeaver.properties File -

case of the keywords (UPPER, LOWER or ORIGINAL)

sql.formatter.keyword.case=UPPER

Statement delimiter

sql.formatter.statement.delimiter=;

Indentation style (space or tab)

sql.formatter.indent.type=space

Number of identation characters

sql.formatter.indent.size=4

Note: - symbol is valid in table or database names. No spaces should be added in between object names.