Aggregate linter messages belonging to the same category#90
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3cc9605bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| parser = _run_parser(search_string, platform=platform, field_general=field_general) | ||
|
|
||
| return parser.linter.messages # type: ignore | ||
| return aggregate_linter_messages(parser.linter.messages) # type: ignore |
There was a problem hiding this comment.
Skip aggregation for list-parser message maps
lint_query_string now unconditionally calls aggregate_linter_messages(parser.linter.messages), but _run_parser routes list-style inputs (queries containing "1.") to LIST_PARSERS, where parser.linter.messages is a dict keyed by list line number rather than a list of message dicts. Iterating that dict in aggregate_linter_messages yields integers, causing an AttributeError ('int' object has no attribute 'get') for list queries with any linter output (e.g., typical WoS/PubMed list searches), so this API path now fails at runtime instead of returning messages.
Useful? React with 👍 / 👎.
| self.linter.validate_query_tree(query) | ||
| self.linter.check_status() | ||
|
|
||
| self.linter.messages = aggregate_linter_messages(self.linter.messages) |
There was a problem hiding this comment.
Keep EBSCO messages unaggregated before node assignment
Aggregating inside EBSCOParser.parse collapses same-category messages from different positions into one message before EBSCOListParser calls assign_linter_messages, but that assignment logic maps each message to a single list node using only the first position. As a result, in list queries where the same warning appears on multiple lines, only the first matching line keeps the warning and other affected lines lose it, which regresses per-line diagnostics for EBSCO list parsing.
Useful? React with 👍 / 👎.
No description provided.