Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive LT01 with COMMENT ON FUNCTION ... IS #5808

Open
2 of 3 tasks
maciejb opened this issue Apr 23, 2024 · 2 comments · May be fixed by #5809
Open
2 of 3 tasks

False positive LT01 with COMMENT ON FUNCTION ... IS #5808

maciejb opened this issue Apr 23, 2024 · 2 comments · May be fixed by #5809
Labels
bug Something isn't working fix corrupts sql For identifying issues where running the fix command actually breaks the SQL - bad! postgres Issues relating to the Postgres dialect

Comments

@maciejb
Copy link

maciejb commented Apr 23, 2024

Search before asking

  • I searched the issues and found no similar issues.

What Happened

sqlfluff detects a false violation of LT01 with Postgres code in the form of

COMMENT ON FUNCTION x IS 'y';

If fix is applied, it will be changed to:

COMMENT ON FUNCTION xIS 'y';

Expected Behaviour

No violation should be found.

Observed Behaviour

Linting fails LT01

L:   1 | P:  22 | LT01 | Unexpected whitespace before 'IS' keyword.
                       | [layout.spacing]

How to reproduce

echo "COMMENT ON FUNCTION x IS 'y';" | sqlfluff lint --dialect postgres -

Dialect

postgres

Version

3.0.3

Configuration

None

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

@maciejb maciejb added the bug Something isn't working label Apr 23, 2024
@maciejb
Copy link
Author

maciejb commented Apr 23, 2024

Worth noting that this is not an issue when the function is qualified with arguments, e.g. COMMENT ON FUNCTION x(text) IS 'y';

@WittierDinosaur
Copy link
Contributor

That is weird 🤔

@WittierDinosaur WittierDinosaur added postgres Issues relating to the Postgres dialect fix corrupts sql For identifying issues where running the fix command actually breaks the SQL - bad! labels Apr 24, 2024
@WittierDinosaur WittierDinosaur linked a pull request Apr 24, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix corrupts sql For identifying issues where running the fix command actually breaks the SQL - bad! postgres Issues relating to the Postgres dialect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants