Fix code review issues: dead code, error handling, alignment, DRY defaults#2
Merged
Conversation
… defaults - Remove unused modes/tail.py (run_tail was never called from cli.py) - Surface config parse errors (bad YAML, invalid structure) instead of silently swallowing them; introduce ConfigFileNotFoundError subclass so only a missing default config file is allowed to be ignored - Fix --align flag being silently ignored in TUI modes by threading it through MessageLogWidget - Highlight the pre-selected stream in StreamsWidget.update_streams (active_id was accepted but never applied) - Check all poll results for GraylogAuthError in dashboard _poll, not just messages - Remove unused formatter.detect_color() - Narrow except Exception to except ValueError for JSON parse errors in client - Replace list + manual slice with deque(maxlen=60) in ThroughputWidget - Extract DEFAULT_FIELDS, DEFAULT_RANGE_SECONDS, DEFAULT_POLL_INTERVAL_MS constants to config.py and use them everywhere instead of repeated literals Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
modes/tail.py(run_tail) was never called fromcli.py; deleted entirely--host is requiredmessage; addsConfigFileNotFoundErrorsubclass so only a missing default config path is silently ignored--alignwired up in TUI modes: The flag was stored but never passed toMessageLogWidget; now threaded through bothGraylogDashboardandLogsOnlyAppStreamsWidget.update_streamsacceptedactive_idbut never applied it; now setslv.indexafter populating the list_pollpreviously only calledself.exit()for auth errors on the messages fetch; now checks all three resultsdetect_color()removed: Defined informatter.pybut never imported or calledexcept Exceptionnarrowed: JSON parse errors inclient.pynow catchValueErrorinstead of bareExceptionThroughputWidget._datausesdeque(maxlen=60): Replaces list + manual slice reassignmentDEFAULT_FIELDS,DEFAULT_RANGE_SECONDS,DEFAULT_POLL_INTERVAL_MSextracted toconfig.pyand used acrossconfig.py,client.py, andcli.pyTest plan
uv run pytest)mypyclean (uv run mypy src/)ruffclean (uv run ruff check src/)🤖 Generated with Claude Code