Skip to content

feat: test multiple args#60

Merged
fgvieira merged 6 commits into
snakemake:masterfrom
fgvieira:is_arg_multiple
Jul 23, 2026
Merged

feat: test multiple args#60
fgvieira merged 6 commits into
snakemake:masterfrom
fgvieira:is_arg_multiple

Conversation

@fgvieira

@fgvieira fgvieira commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Allow for multiple args when searching a command line.

Summary by CodeRabbit

  • New Features

    • Command-line argument lookup and presence checks now support multiple alternative arguments provided as a list, returning positions and presence results for each entry.
  • Bug Fixes

    • None. Existing single-argument checks keep the same behavior as before.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@fgvieira, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 77960e9f-fd60-4f56-b603-cb316668829f

📥 Commits

Reviewing files that changed from the base of the PR and between bb8184c and 4f437fc.

📒 Files selected for processing (1)
  • snakemake_wrapper_utils/snakemake.py
📝 Walkthrough

Walkthrough

Added helpers for locating multiple arguments and checking their presence in a command. Existing single-argument lookup and presence behavior remains unchanged.

Changes

Argument helper updates

Layer / File(s) Summary
Multi-argument lookup and presence checks
snakemake_wrapper_utils/snakemake.py
Adds get_args for per-argument positions and are_args for per-argument presence booleans, using the existing get_arg behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

🚥 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 is related to the change, since the PR adds support for handling multiple args, though it is a bit vague about the exact behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@snakemake_wrapper_utils/snakemake.py`:
- Around line 41-50: Restore the _get_arg helper as a valid function definition,
preserving its existing list_arg(cmd).index(arg) lookup and None-on-ValueError
behavior. In the scalar branch of is_arg, return _get_arg(args, cmd) instead of
discarding the result, while leaving the list-argument mapping behavior
unchanged.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 937e598a-e735-46d6-a434-829e707bb708

📥 Commits

Reviewing files that changed from the base of the PR and between 1f0b732 and bf0e0b2.

📒 Files selected for processing (1)
  • snakemake_wrapper_utils/snakemake.py

Comment thread snakemake_wrapper_utils/snakemake.py Outdated
@fgvieira
fgvieira requested a review from dlaehnemann July 22, 2026 12:16

@dlaehnemann dlaehnemann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This generally looks sound, but I have two suggestions (which I also tried to set up in my code suggestion, but please double-check!):

  1. I would leave the original functions as is and just create wrapper functions that call them. This just looks a bit cleaner to me and makes the backwards compatibility more explicit.
  2. I am not sure the is_arg() construct was correct with the any() function. I think we need an all() here, to ensure that none of the args is None.

Also, I guess we do not have unit tests in snakemake_wrapper_utils, right? They might be useful to double-check things like 2.... 😅

Comment thread snakemake_wrapper_utils/snakemake.py Outdated

@dlaehnemann dlaehnemann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. So if you want to use those wrappers, feel free to merge as is.

@fgvieira fgvieira changed the title feat: allow for multiple args feat: test multiple args Jul 23, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@snakemake_wrapper_utils/snakemake.py`:
- Around line 45-47: Update the `get_args` function declaration to include the
required trailing colon so the module parses successfully; leave its existing
list-comprehension behavior unchanged.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: df6b5a41-5a8e-4805-aa6e-9d9c66f799f3

📥 Commits

Reviewing files that changed from the base of the PR and between bf0e0b2 and bb8184c.

📒 Files selected for processing (1)
  • snakemake_wrapper_utils/snakemake.py

Comment thread snakemake_wrapper_utils/snakemake.py Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@fgvieira
fgvieira merged commit e060665 into snakemake:master Jul 23, 2026
3 checks passed
@fgvieira
fgvieira deleted the is_arg_multiple branch July 23, 2026 10:48
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.

2 participants