feat(safegres): consume @pgsql/lint instead of the bundled linter copy - #1617
Merged
Conversation
Depend on @pgsql/lint@^18.1.0 and turn src/lint into a thin re-export; delete the duplicated engine/rules/suppressions/parse-unit now that the standalone package is published. safegres keeps its catalog introspection, audit orchestration, config/preset, scoring, and finding mapping.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Repoint safegres's source-level convention linter at the now-published standalone package
@pgsql/lint@18.1.0(extracted in constructive-io/pgsql-parser#335), removing the duplicated copy that shipped inpackages/safegres/src/lint/*. This is step two of "extract, then repoint" — the code was ported verbatim into@pgsql/lint, so this is a dependency swap, not a behavior change.src/lint/index.tsbecomes a thin re-export so nothing else in safegres changes —src/commands/audit.tsand the tests keep importing the same symbols from../lint:Deleted (now sourced from
@pgsql/lint):engine.ts,parse-unit.ts,suppressions.ts,types.ts,util.ts,rules/*. Theaudit.tscall site is unchanged:@pgsql/lint's default suppression keywords are['pgsql-lint', 'safegres'], so existingsafegres-disable …waivers keep working (superset). The newseverityfield it attaches to problems is ignored by safegres, which maps findings through its own registry as before.What stays in safegres
Everything database-dependent: catalog introspection (
pg/*,pg_get_functiondef), audit orchestration, exposure/ACL/RLS analysis, scoring, preset/severity config, and finding mapping. safegres is now "the catalog adapter" over the shared engine.Testing
packages/safegresfull suite: 399 tests pass (Postgres up viapgpm docker), includinglint.test.ts(15, pure) andlint-audit.test.ts(6, end-to-end audit wiring) now running against@pgsql/lint.pnpm --filter safegres build+lintclean (2 pre-existing unrelated warnings inconfig/loader.ts).@pgsql/lint@18.1.0entries (prettier-formatted to match repo style); its transitive deps reuse existing resolved versions.Follow-up
None outstanding — this completes the extract-then-repoint arc (pgsql-parser#334
@pgsql/semantics, #335@pgsql/lint, this PR).Link to Devin session: https://app.devin.ai/sessions/af81a09043504701874ca63e67a9cd4b
Requested by: @pyramation