Tracking sqlfluff issue fixes to remove remaining files from pre-commit exclusion
We removed scripts/solr_builder/sql/prod-partial-dump.sql exclusion from the exclude list in .pre-commit-config.yaml in PR #12243 closing #11919
But the scripts/solr_builder/sql/import-partial.sql and scripts/dev-instance/patron_data.sql cannot be excluded until sqlfluff/sqlfluff#7696 and sqlfluff/sqlfluff#7697 are fixed.
After the fix we can :
- Update the new sqlfluff version.
- And remove
scripts/dev-instance/patron_data.sqlandscripts/solr_builder/sql/import-partial.sqlfrom theexcludelist in.pre-commit-config.yaml.
Releases: https://github.com/sqlfluff/sqlfluff/releases
Looks like both of the above issues are fixed. Now we just need a new release > 4.2.2 https://github.com/sqlfluff/sqlfluff/releases
@RayBB sqlfluff 4.3.0 (released Aug 7) includes both fixes, so I checked the two excluded files against it locally:
scripts/dev-instance/patron_data.sqlnow parses. What's left is 11 style findings on lines 120–129 (LT14, ST05, RF02), all in the hand-writtenINSERT … (SELECT …)statements at the end.scripts/solr_builder/sql/import-partial.sql: the:sourceplaceholder parses now, but sqlfluff still can't parse the old pre-9.0 COPY option syntax on line 8,WITH delimiter E'\t' quote E'\b' csv. The equivalent modern form,WITH (FORMAT csv, DELIMITER E'\t', QUOTE E'\b'), lints clean.
I'd like to take this. The PR would bump sqlfluff to 4.3.0, remove both exclusions, switch that COPY to the modern option syntax, and fix the patron_data.sql findings (LT14 via sqlfluff fix; for ST05/RF02 either rewrite those inserts with CTEs or add a targeted -- noqa, whichever you prefer for a seed file). Is changing the COPY syntax in the solr_builder script OK, or would you rather keep that file excluded for now?