Skip to content

[Bug]: LT05 not fixed #1986

@austinbutler

Description

@austinbutler

What happened?

LT05 is marked fixable:

sqruff/docs/rules.md

Lines 1418 to 1422 in 18965ac

**Code:** `LT05`
**Groups:** `all`, `core`, `layout`
**Fixable:** Yes

However this simple SQL:

SELECT COUNT(*)
FROM policies
WHERE
    is_active_policy IS TRUE AND active_policy = 'Authorized' AND exclude_from_checks IS TRUE;

Results in LT05 and no change to the line length.

sqruff fix sqruff_issue.sql
== [sqruff_issue.sql] FAIL
L:   4 | P:   5 | LT05 | Line is too long (94 > 80).
                       | [layout.long_lines]
The linter processed 1 file(s).
All Finished 📜 🎉

If I make a simple change to the SQL:

SELECT COUNT(*)
FROM policies
WHERE
    is_active_policy IS TRUE AND active_policy = 'Authorized'
    AND exclude_from_checks IS TRUE;

Then all is well.

sqruff fix sqruff_issue.sql
1 files processed, nothing to fix.

Is there a reason sqruff can't do the same? For context I never used the sqlfluff project that this appears to be based on so maybe I'm misunderstanding how this should work.

Version

sqruff --version
sqruff 0.29.3

Checked in Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions