Skip to content

Add standard short -v verbosity option - #477

Merged
cclauss merged 2 commits into
cpplint:developfrom
zxc1031408077:codex/issue-331-short-v
Nov 11, 2026
Merged

cclauss merged 2 commits into
cpplint:developfrom
zxc1031408077:codex/issue-331-short-v

Conversation

@zxc1031408077

@zxc1031408077 zxc1031408077 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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. Provide a value as -v 2 or -v2; the existing --verbose and --v options remain available.
  • Documentation
    • Updated the changelog and command-line usage text to describe the -v alias and its required value.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The command-line parser now accepts -v with a required verbosity value. The usage text and changelog document this alias. A test covers 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.

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

Change: Feature

Suggested reviewers: aaronliu0130

Merge Risk: Minimal · up to 03d63

The new verbosity alias appears ready to merge after normal checks.

Pre-merge checks: Passed 5

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 verbosity option.
Linked Issues check Passed Issue #331 identifies the non-standard --v spelling and warns that replacement could break users. The PR adds -v while retaining --v and --verbose. The summary shows support for -v 2 and `-v…
Out of Scope Changes check Passed The reported changes are limited to the #331 option parser, usage text, parser tests, and changelog entry. These changes directly support the linked issue. No unrelated changes are shown in the availa…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #331 identifies the non-standard --v spelling and warns that replacement could break users. The PR adds -v while retaining --v and --verbose. The summary shows support for -v 2 and -v3, usage documentation, parser tests, and a CHANGELOG.rst entry.

Full details: Out of Scope Changes check

Explanation

The reported changes are limited to the #331 option parser, usage text, parser tests, and changelog entry. These changes directly support the linked issue. No unrelated changes are shown in the available whole-PR summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e394d130-092f-4e8d-9b50-24108cfcb931
Commits

Reviewing files that changed from the base of the PR and between ef038df and 03d63bb.

Files selected for processing: 3

  • CHANGELOG.rst
  • cpplint.py
  • cpplint_unittest.py
Files skipped from review as they are similar to previous changes: 1

  • CHANGELOG.rst

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

@DanceoftheAurora

Copy link
Copy Markdown

I prepared an optional merge of the current develop into this PR: c611145, on fix/pr477-merge-develop.

The only manual conflict was in CHANGELOG.rst; both entries are retained. The -v implementation and its tests are unchanged. The merge preserves both histories and can be merged into your branch if useful.

Validation on the merged version: 242 tests passed, 96.66% coverage; configured Pylint, Mypy, and applicable pre-commit hooks passed. Prepared with AI assistance.

@cclauss
cclauss merged commit 1e7f9d4 into cpplint:develop Nov 11, 2026
8 checks passed
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

3 participants