Skip to content

Commit a7bb8bc

Browse files
mention issue 45 in no code style section
1 parent df640ae commit a7bb8bc

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

docs/src/content/docs/reference/principles.mdx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,28 @@ Nevertheless, the Oracle Data Dictionary contains a great deal of information fo
4444
### No Code Style
4545

4646
Rules related to formatting are not part of the dbLinter ruleset.
47-
It will be a separate product/component with a separate configuration.
47+
4848
A formatter can be applied to a selection of code, a file, or the entire project, and deals with whitespace between tokens.
4949
Case conventions for keywords and identifiers are sometimes also handled by a formatter.
5050
All these rules are not part of dbLinter.
5151

5252
However, there are a lot of similarities between formatter rules and other rules.
53-
SQLFluff is a tooling that uses normal rules to configure its formatter.
53+
SQLFluff or the ESLint Stylistic plugin use normal rules to configure the formatter.
5454
The impact of the formatter is something which can be shown quite well with rules.
5555

5656
A main difference is, that some formatter rules are mandatory (e.g. setting the line length or the tab size etc.).
57-
As a result some rules cannot be disabled, they have to be configured. E.g. identifiers. upper/lower/ignore.
58-
59-
For SQL-based tests we have found a way to combine them with static code analysis.
60-
We still need to define how we want to treat formatter rules.
61-
Therefore, for the time being we exclude formatter/code style rules.
57+
As a result some rules cannot be disabled, they have to be configured.
58+
They need a behaviour. Either explicitly or implicitly by a default. For example:
59+
60+
- Keyword case: upper, lower, ignore (keep)
61+
- Identifier case: upper, lower, pascal, camel, ignore (keep)
62+
- Number of spaces used for an indentation: 2, 3, 4, 8, ...
63+
- Max. line length: 80, 100, 120, ...
64+
- Commas: leading, trailing
65+
66+
There is an open [GitHub issue]((https://github.com/Grisselbav/dbLinter/issues/45)) suggesting a new rule:
67+
'Always format database code consistently'. This issue discusses how
68+
formatter rules can be integrated into dbLinter.
6269

6370
### Not Contradictory
6471

0 commit comments

Comments
 (0)