Skip to content

feat: remove status messages and make --debug require --verbose - #11

Merged
dreamiurg merged 1 commit into
mainfrom
feat/remove-status-messages
Oct 24, 2025
Merged

feat: remove status messages and make --debug require --verbose#11
dreamiurg merged 1 commit into
mainfrom
feat/remove-status-messages

Conversation

@dreamiurg

@dreamiurg dreamiurg commented Oct 24, 2025

Copy link
Copy Markdown
Owner

Summary

  • Removes all status messages like "Fetching peak ###" from CLI output
  • Makes --debug flag require --verbose flag
  • CLI is now silent by default except for data output and errors

Changes

  • ✅ Remove all _status() calls and the unused function
  • ✅ Add validation requiring --verbose flag when using --debug
  • ✅ Update --debug help text to indicate it requires --verbose
  • ✅ Update CLAUDE.md logging guidelines
  • ✅ Update README.md sample outputs to remove status messages
  • ✅ Fix mypy type errors in date filter code

Behavior

Before:

$ peakbagger peak show 2296
Fetching peak 2296...
[peak data displayed]

After:

$ peakbagger peak show 2296
[peak data displayed - no status messages]

$ peakbagger --verbose peak show 2296
[INFO logs on stderr] + [peak data on stdout]

$ peakbagger --verbose --debug peak show 2296
[DEBUG + INFO logs on stderr] + [peak data on stdout]

Test plan

  • Tested default output has no status messages
  • Tested --verbose shows INFO logs
  • Tested --verbose --debug shows DEBUG logs
  • Tested --debug without --verbose shows error
  • Tested JSON output remains clean
  • All pre-commit hooks pass
  • mypy type checking passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated to reflect main branch as primary for releases and commits; clarified verbose and debug logging modes.
  • Changes

    • CLI is now silent by default, showing only errors and results; --debug now requires --verbose flag.

Removes all status messages like "Fetching peak ###" from CLI output.
CLI is now silent by default except for data output and errors.

Changes:
- Remove all _status() calls and the function itself
- Add validation requiring --verbose flag when using --debug
- Update --debug help text to indicate it requires --verbose
- Update CLAUDE.md logging guidelines and documentation
- Update README.md sample outputs to remove status messages
- Fix mypy type errors in date filter code

Users who want logging should use --verbose for INFO logs or
--verbose --debug for DEBUG logs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 24, 2025

Copy link
Copy Markdown

Walkthrough

This PR migrates the project from dual master/main branch support to main-only, updates logging to be silent by default with new --debug/--verbose guidelines, and removes status message functions from the CLI to suppress progress output during execution.

Changes

Cohort / File(s) Summary
Branch Configuration Migration
.github/workflows/release.yml, .pre-commit-config.yaml, .releaserc.json
Removes master branch references, restricting release and commit workflows to main branch only across CI/CD and semantic-release configurations.
Documentation Updates
CLAUDE.md, README.md
Updates setup and release workflow documentation to reflect main-only branch usage; adds logging guidelines detailing silent-by-default behavior, --verbose (INFO level), and --debug (requires --verbose, enables DEBUG level); removes sample output lines showing progress messages.
CLI Refactoring
peakbagger/cli.py
Removes module-level _status helper function and all status message calls across commands (search, show, ascents, stats, show_ascent); adds runtime validation requiring --verbose when --debug is used; updates date-filter variable handling with explicit type annotations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

The changes span multiple file types with mixed complexity: configuration updates are straightforward (branch reference removals), documentation is largely descriptive, but the CLI refactoring involves logic removal and new validation patterns that warrant attention.

Possibly related PRs

Poem

🐰 Master's gone, long live main—
Branch so clean, no more refrain!
Silent CLI, quiet and keen,
Status whispers fade unseen.
Hop on, dear main, our future's bright! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: remove status messages and make --debug require --verbose" directly and clearly describes the primary functional changes in this pull request. The changeset's main content involves removing status message outputs from the CLI (affecting peakbagger/cli.py and documentation) and adding a validation requirement that --debug must be paired with --verbose. While the PR also includes supporting changes to branch configuration files and documentation across multiple files, the title appropriately focuses on the most significant user-facing behavioral changes. The title is concise, specific, and avoids vague terminology.
Description Check ✅ Passed The PR description is mostly complete and well-structured, including a clear Summary section that explains the core changes, a comprehensive Changes section with checkmarks indicating completed tasks, a Behavior section with before/after examples showing the new CLI output patterns, and a Test plan section documenting what was validated. The only element missing from the template is the formal Type section with checkboxes (feat/fix/feat!/fix!/chore/docs/refactor/test/ci), though the type is already indicated in the PR title prefix "feat:" which satisfies the requirement. The description provides substantial detail about the changes and their impact, making it a valuable reference for reviewers and the project history.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/remove-status-messages

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0561350 and ac72bd9.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/release.yml (0 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • .releaserc.json (1 hunks)
  • CLAUDE.md (5 hunks)
  • README.md (0 hunks)
  • peakbagger/cli.py (5 hunks)
💤 Files with no reviewable changes (2)
  • README.md
  • .github/workflows/release.yml
🧰 Additional context used
📓 Path-based instructions (6)
{peakbagger,tests,scripts}/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

Use Python 3.12+ modern typing; prefer X | None instead of Optional[X]

Files:

  • peakbagger/cli.py
peakbagger/**/*.py

📄 CodeRabbit inference engine (CLAUDE.md)

peakbagger/**/*.py: All public functions and classes must have docstrings
Add type hints for all function parameters and return values
Use proper exception chaining (raise ... from e) for error handling
Never use print() for debugging or informational logs; use loguru logger

Files:

  • peakbagger/cli.py
peakbagger/{cli.py,formatters.py}

📄 CodeRabbit inference engine (CLAUDE.md)

Use Rich for all user-facing terminal output; do not use print() for UI output

Files:

  • peakbagger/cli.py
peakbagger/{logging_config.py,cli.py}

📄 CodeRabbit inference engine (CLAUDE.md)

Default log level is CRITICAL; users enable via --verbose (INFO) or --debug (DEBUG) flags

Files:

  • peakbagger/cli.py
{peakbagger/cli.py,peakbagger/client.py}

📄 CodeRabbit inference engine (CLAUDE.md)

Respect and expose rate limiting via CLI flags (e.g., --rate-limit), defaulting to 2.0 seconds

Files:

  • peakbagger/cli.py
CLAUDE.md

📄 CodeRabbit inference engine (CLAUDE.md)

Update CLAUDE.md when new output fields or formats are added

Files:

  • CLAUDE.md
🧠 Learnings (6)
📚 Learning: 2025-10-23T23:51:41.271Z
Learnt from: CR
PR: dreamiurg/peakbagger-cli#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-23T23:51:41.271Z
Learning: Applies to peakbagger/{cli.py,formatters.py} : Use Rich for all user-facing terminal output; do not use print() for UI output

Applied to files:

  • peakbagger/cli.py
📚 Learning: 2025-10-23T23:51:41.271Z
Learnt from: CR
PR: dreamiurg/peakbagger-cli#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-23T23:51:41.271Z
Learning: Applies to CLAUDE.md : Update CLAUDE.md when new output fields or formats are added

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-10-23T23:51:41.271Z
Learnt from: CR
PR: dreamiurg/peakbagger-cli#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-23T23:51:41.271Z
Learning: Manage Node.js dependencies for semantic-release with npm; releases run via GitHub Actions

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-10-23T23:51:41.271Z
Learnt from: CR
PR: dreamiurg/peakbagger-cli#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-23T23:51:41.271Z
Learning: Applies to peakbagger/{logging_config.py,cli.py} : Default log level is CRITICAL; users enable via --verbose (INFO) or --debug (DEBUG) flags

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-10-23T23:51:41.271Z
Learnt from: CR
PR: dreamiurg/peakbagger-cli#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-23T23:51:41.271Z
Learning: Applies to peakbagger/logging_config.py : All logs must go to stderr; format: Verbose `HH:MM:SS | LEVEL | message`, Debug `HH:MM:SS | LEVEL | file:line - message`

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-10-23T23:51:41.271Z
Learnt from: CR
PR: dreamiurg/peakbagger-cli#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-23T23:51:41.271Z
Learning: Applies to peakbagger/**/*.py : Never use print() for debugging or informational logs; use loguru logger

Applied to files:

  • CLAUDE.md
🧬 Code graph analysis (1)
peakbagger/cli.py (1)
peakbagger/statistics.py (1)
  • filter_by_date_range (130-173)
🪛 Ruff (0.14.1)
peakbagger/cli.py

66-66: Avoid specifying long messages outside the exception class

(TRY003)

🔇 Additional comments (9)
.releaserc.json (1)

2-2: LGTM!

The migration to main-only is clean and aligns with the branch protection changes in .pre-commit-config.yaml and the workflow updates mentioned in the PR summary.

.pre-commit-config.yaml (1)

10-11: LGTM!

The branch protection update is consistent with the semantic-release configuration and completes the migration to main-only workflow.

peakbagger/cli.py (4)

17-18: LGTM!

The updated comment accurately reflects the console's purpose for error messages and clarifies the stderr/stdout separation strategy.


54-66: LGTM! Validation correctly enforces --debug dependency.

The help text clearly indicates the requirement, and the validation logic properly enforces that --debug requires --verbose. The error message is clear and actionable.


338-348: LGTM! Type annotations improve type safety.

The explicit type annotations for after_date and the introduction of after_date_opt/before_date_opt variables properly resolve mypy type errors while maintaining code clarity. The _opt suffix effectively indicates these are optional datetime values.


483-493: LGTM! Consistent type safety improvements.

The type annotations mirror the changes in the ascents command and properly resolve mypy type errors. The consistent approach across both commands improves maintainability.

CLAUDE.md (3)

29-29: LGTM! Documentation accurately reflects main-only workflow.

The removal of master branch references is consistent with the configuration changes in .releaserc.json and .pre-commit-config.yaml.


200-211: LGTM! Logging guidelines accurately document the new behavior.

The documentation correctly reflects:

  • Silent CLI output by default (no status messages)
  • The requirement that --debug needs --verbose
  • Clear separation between verbose (INFO) and debug (DEBUG) modes

These changes align perfectly with the code implementation in peakbagger/cli.py.


221-250: LGTM! Release process documentation is accurate.

The updates correctly reflect the main-only workflow for automated releases, consistent with the .releaserc.json configuration.


Comment @coderabbitai help to get the list of available commands and usage tips.

@dreamiurg
dreamiurg merged commit 336ed7a into main Oct 24, 2025
3 checks passed
dreamiurg pushed a commit that referenced this pull request Oct 24, 2025
# [1.5.0](v1.4.0...v1.5.0) (2025-10-24)

### Bug Fixes

* disable text wrapping in all Rich tables and fix JSON output ([#12](#12)) ([3377472](3377472))

### Features

* additional --verbose and --debug logging options ([#8](#8)) ([1faa61c](1faa61c))
* remove status messages and make --debug require --verbose ([#11](#11)) ([336ed7a](336ed7a))
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dreamiurg
dreamiurg deleted the feat/remove-status-messages branch October 24, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant