Visitar URL original
Add standard short -v verbosity option by zxc1031408077 · Pull Request #477 · cpplint/cpplint · GitHub
Skip to content

Add standard short -v verbosity option - #477

Open
zxc1031408077 wants to merge 1 commit into
cpplint:developfrom
zxc1031408077:codex/issue-331-short-v
Open

zxc1031408077 wants to merge 1 commit into
cpplint:developfrom
zxc1031408077:codex/issue-331-short-v

Conversation

@zxc1031408077

@zxc1031408077 zxc1031408077 commented Oct 17, 2026 •

Copy link
Copy Markdown

Summary

Add -v as the standard short option for setting cpplint's verbosity level. The existing --v and --verbose options remain supported for compatibility.

Changes

  • Register -v with getopt and accept both -v 2 and -v3 forms.
  • Route -v through the existing verbosity handling.
  • Document the short option in the command-line usage text.
  • Add parser coverage for both short-option forms.
  • Record the change in CHANGELOG.rst.

Compatibility

This is additive. Existing --v and --verbose invocations are unchanged.

Verification

  • python -m pytest --no-cov — 232 passed
  • pre-commit hooks — passed
  • mypy — passed
  • pylint — passed
  • compileall and diff checks — passed

Fixes #331

Summary by CodeRabbit

  • New Features
    • Added support for the -v short option to set verbosity, including both -v 2 and -v2 formats. The existing --verbose and --v options remain supported.
  • Documentation
    • Updated the changelog and command-line usage text to document the -v alias.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 48202d8e-7bb3-4bfe-843a-6225f5c8a62f
📥 Commits

Reviewing files that changed from the base of the PR and between 926bf4b and ef038df.

📒 Files selected for processing: 3
  • CHANGELOG.rst
  • cpplint.py
  • cpplint_unittest.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The command-line parser now accepts -v with a required verbosity value. The usage text and changelog document this alias, and a test covers both separated and attached values.

Changes: Verbosity option

Layer / File(s) Summary
Add and verify the short verbosity option
cpplint.py, cpplint_unittest.py, CHANGELOG.rst
The usage text documents -v#. Argument parsing accepts -v alongside --verbose and --v. The test checks -v 2 and -v3, and the changelog records the alias.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: aaronliu0130

Merge Risk: ⚪ Minimal · up to ef038

The change adds the requested short verbosity option while retaining the existing aliases, and the supplied test summary covers both supported forms. No concrete merge-blocking issue is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: adding the standard short -v option for verbosity.
Linked Issues check Passed Issue #331 requires the standard -v spelling without breaking existing verbosity options. The PR evidence shows cpplint.py documents -v#, parses both -v 2 and -v3, and retains --v and `--v…
Out of Scope Changes check Passed The reviewed changes are limited to the #331 verbosity option, its usage text, parser tests, and changelog entry. These tests and documentation directly support the issue objective. No unrelated chang…
Full details: Linked Issues check

Explanation

Issue #331 requires the standard -v spelling without breaking existing verbosity options. The PR evidence shows cpplint.py documents -v#, parses both -v 2 and -v3, and retains --v and --verbose. cpplint_unittest.py covers both short-option forms. CHANGELOG.rst records the change.

Full details: Out of Scope Changes check

Explanation

The reviewed changes are limited to the #331 verbosity option, its usage text, parser tests, and changelog entry. These tests and documentation directly support the issue objective. No unrelated change is shown in the supplied whole-PR summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This branch has not been deployed

No deployments
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.

Verbose command line option is --v instead of -v

2 participants