fix(linter): deduplicate issues and make their order total - #86
Merged
Conversation
A rule that reaches the same problem by more than one route reported it twice, and findings sharing a position and a rule ID came back in an unspecified order because the sort had no tiebreaker beyond the rule ID. LintDocument now drops issues matching in every field, and orders equal positions by rule ID then message. After deduplication that key is unique, so the order is total and a document always lints to the same sequence. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014XrANytHY1H4cV7Wm8bBdv
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
Enhanced the linter's issue reporting to provide deterministic, deduplicated output by sorting findings by message as a tertiary sort key and deduplicating identical issues.
Key Changes
LintDocumentdocstring to clarify the sorting behavior and deduplication guaranteeImplementation Details
Issueto track seen findings before appending to resultsTestLintDocument_SortsByMessageAtSamePosition: Verifies message-based sorting when position and rule ID matchTestLintDocument_Deduplicates: Tests deduplication across various scenarios (identical findings, differing columns/lines/messages/rule IDs)https://claude.ai/code/session_014XrANytHY1H4cV7Wm8bBdv