Skip to content

Have verbosity default to level 1 in simulate mode#138

Open
ccjmne wants to merge 2 commits into
aspiers:masterfrom
ccjmne:default-verbosity-one-with-simulate
Open

Have verbosity default to level 1 in simulate mode#138
ccjmne wants to merge 2 commits into
aspiers:masterfrom
ccjmne:default-verbosity-one-with-simulate

Conversation

@ccjmne

@ccjmne ccjmne commented Apr 28, 2026

Copy link
Copy Markdown

Currently, using stow --simulate <package> would normally only output:

WARNING: in simulation mode so not modifying filesystem.

It is generally meant to be used with --verbose for some more more comprehensive simulation result.

This Pull Request only brings the default verbosity to 1 from the generic 0, but still allows for explicit disabling with --verbosity=0.

Also includes some simple test.

Fixes #82.

Summary by CodeRabbit

  • New Features
    • Simulation mode (--simulate) now enables verbose output by default for more detailed logging, unless you explicitly set --verbose=0.
  • Tests
    • Added a CLI options test to verify the simulated default verbosity and that an explicit --verbose=0 overrides it.

Currently, using stow --simulate <package> would normally only output:

    WARNING: in simulation mode so not modifying filesystem.

It is generally meant to be used with --verbose for some more more
comprehensive simulation result.

This commit only brings the *default* verbosity to 1 from the generic 0,
but still allows for explicit disabling with --verbosity=0.

Ref: aspiers#82
Reported-by: Ilya Grigoriev <ilyagr@users.noreply.github.com>
Suggested-by: Gutierri Barboza <me@gutierri.me>
@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c1c61931-53bb-4a61-82f9-99179b62c2c0

📥 Commits

Reviewing files that changed from the base of the PR and between f0eea92 and cdd9282.

📒 Files selected for processing (1)
  • t/cli_options.t

📝 Walkthrough

Walkthrough

When --simulate is used and --verbose is not explicitly provided, option-processing now sets verbose to 1 before later option sanitization and package checks. A new test verifies the simulated default and that an explicit --verbose=0 overrides it.

Changes

Cohort / File(s) Summary
Simulation Verbosity Enhancement
bin/stow.in
Adjusts merged-options processing to set verbose to 1 when --simulate is present and --verbose was not specified by the user.
CLI Options Test Coverage
t/cli_options.t
Adds tests asserting that --simulate without --verbose yields verbose == 1, and that --verbose=0 explicitly overrides the simulated default.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 In simulation fields I hop and peep,
I raise my voice so secrets don't sleep,
Verbose by default when I pretend,
Yet when you hush me, I'll softly end,
Hooray for clear logs — from a rabbit friend!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: making verbosity default to level 1 when simulate mode is active.
Linked Issues check ✅ Passed The changes directly address issue #82 by making --simulate imply verbosity level 1 by default, ensuring simulation produces useful output without requiring explicit -v flag.
Out of Scope Changes check ✅ Passed All changes are within scope: modifications to bin/stow.in implement the default verbosity behavior, and t/cli_options.t adds appropriate test coverage for this feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@t/cli_options.t`:
- Around line 121-138: The top-level Test::More plan still declares "plan tests
=> 6" but you added a new subtest ("simulate defaults verbosity unless
explicitly set") so update the top-level plan to reflect the new total (change
"plan tests => 6" to "plan tests => 7") or switch to no_plan; locate the
existing plan call (the line containing plan tests => 6) and increment it so the
test harness matches the added subtest that uses process_options().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ec3193da-e253-43f3-81d9-e770f85b7b68

📥 Commits

Reviewing files that changed from the base of the PR and between 891c187 and f0eea92.

📒 Files selected for processing (2)
  • bin/stow.in
  • t/cli_options.t

Comment thread t/cli_options.t
@ccjmne ccjmne force-pushed the default-verbosity-one-with-simulate branch from f0eea92 to cdd9282 Compare April 28, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stow --simulate should warn when -v is not specified

1 participant