Skip to content

detached-semicolon

SQLstyleno fixdefault: offsql/sqlfluff

Reports a ; written after a space, a line break or another ;, instead of right after its statement.

The end of a statement is easy to see when the ; sits against the last token. On its own line it reads as a separate, empty statement, and a stray ;; is an empty one.

To fix, write the ; right after the statement.

Reported
...
select 1 ;
select 2
;
select 3 /* c */;
/* d */;
sql:
lint:
rules:
detached-semicolon: warn # off (default), warn, error

Enabled by the presets: sql/sqlfluff.

Suppress one line with sudsy-disable-next-line detached-semicolon in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
sqlfluff CV06 full