Replace PlannedChange string slices with structured Violations field#689
Merged
Conversation
dd77d80 to
6894dc5
Compare
PlannedChange now carries a single Violations []Violation field instead of separate Errors/Warnings/Infos []string slices. Errors(), Warnings(), and Infos() are methods that filter by severity, returning []Violation. Consumers that need the formatted string can call v.String() on each violation. This gives downstream consumers direct access to structured fields (Message, Suggestion, Location, Severity) for richer formatting without parsing the String() output. Closes #688 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6894dc5 to
e131e2c
Compare
aparajon
added a commit
to block/schemabot
that referenced
this pull request
Apr 14, 2026
Consume block/spirit#689 which replaces PlannedChange string slices (Errors/Warnings/Infos []string) with a structured Violations field. Update the Spirit engine adapter to iterate over Violations directly, extracting Linter name and Severity from the new typed fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aparajon
added a commit
to block/schemabot
that referenced
this pull request
Apr 14, 2026
* Bump Spirit to v0.12.1 for structured lint violations Consume block/spirit#689 which replaces PlannedChange string slices (Errors/Warnings/Infos []string) with a structured Violations field. Update the Spirit engine adapter to iterate over Violations directly, extracting Linter name and Severity from the new typed fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Replace TIMESTAMP with DATETIME in test schemas The updated Spirit version includes a new linter that flags TIMESTAMP columns for 2038 overflow. Switch test DDL to DATETIME to avoid spurious unsafe-change errors in tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address Copilot review: rename errors var, add lint mapping test Rename `errors` to `errViolations` to avoid shadowing the stdlib `errors` package. Add an integration test that triggers a known Spirit linter (TIMESTAMP Y2038 overflow) and asserts the resulting LintWarning fields (linter name, severity, message) are correctly mapped from Spirit's structured Violation type. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Rename LintWarning to LintViolation across codebase Aligns naming with Spirit's structured Violation type. Since there are no external consumers yet, this is a clean rename with no backwards compatibility concerns. Updated proto, apitypes, engine, CLI, webhook, and all test files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
PlannedChange now carries a single
Violations []Violationfield instead of separateErrors/Warnings/Infos[]stringslices.Errors(),Warnings(), andInfos()are methods that filter by severity, returning[]Violation. Consumers that need the formatted string can callv.String().This is a breaking change for consumers that access the old string fields directly. The migration is straightforward:
change.Errors→change.Errors()(returns[]Violationinstead of[]string)change.Warnings→change.Warnings()change.Infos→change.Infos()v.String()on each violationCloses #688