spotless
spotless copied to clipboard
SQL query formatting issue. Hyphen enclosed in string treated as minus
If you are submitting a bug, please include the following:
- [ Sql query format is not working as expected. There is no option to skip string enclosed in ` (apostrophe) . Certain tables with names including hypen - symbol are treaded as minus and adding space.] summary of problem
- [ ] gradle or maven version
- [ 2.12.1] spotless version
- [ ] operating system and version
- [ ] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
- [ ] copy-paste the full content of any console errors emitted by
gradlew spotless[Apply/Check] --stacktrace
If you're just submitting a feature request or question, no need for the above.
Happy to take a bugfix PR. It would help to have a concrete example with:
- input
- expected output
- actual output
@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 -
<dbeaver>
<configFile>dbeaver.properties</configFile> <!-- configFile is optional -->
</dbeaver> <!-- has its own section below -->
</sql>
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.