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

Overzealous SQL linting #720

Open
liffiton opened this issue Jun 25, 2024 · 1 comment
Open

Overzealous SQL linting #720

liffiton opened this issue Jun 25, 2024 · 1 comment
Labels
question Further information is requested

Comments

@liffiton
Copy link

Issue

The linter is consistently marking various lines in SQL edits as incorrect when they are not. I've seen it mark lots of primary key column defs, some PRAGMA statements, and at least one non-primary-key column def. The spurious issues aren't the end of the world, but they add friction.

Just to see, I let Sonnet-3.5 try to fix one such issue, and it agreed there's no issue:

# Fix any errors below, if possible.


## See relevant line below marked with █.

src/gened/migrations/20240608--add_experiment_tables.sql:
...⋮...
  6│
  7│-- Create experiments table
  8│CREATE TABLE experiments (
  9█    id          INTEGER PRIMARY KEY AUTOINCREMENT,
 10│    name        TEXT NOT NULL UNIQUE,
 11│    description TEXT
 12│);
 13│
...⋮...


Attempt to fix lint errors? y
I apologize for the confusion. The migration script you've shown is actually correct
and doesn't contain any errors. The line marked with █ is perfectly valid SQL for
creating a table with an auto-incrementing primary key. There's no need to make any
changes to this file.

If you'd like me to make any specific modifications or if you have any other concerns
about the migration script, please let me know, and I'll be happy to assist you further.

This is a script for SQLite in particular, if it matters. Possibly it's an issue of SQL dialects.

Version and model info

Aider v0.40.0
Models: claude-3-5-sonnet-20240620 with diff edit format, weak model claude-3-haiku-20240307

@paul-gauthier
Copy link
Owner

Thanks for trying aider and filing this issue. I can look into this and try and determine why the sql linter is triggering these spurious issues.

If the sql linting is problematic for you, you could to --lint-cmd sql:echo to disable it.

@paul-gauthier paul-gauthier added the question Further information is requested label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants