Skip to content

Conversation

2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Aug 29, 2025

resolves #321
resolves #323

In nushell, quotes are not required for strings. Quotes were previously used around inputs.* values if they might

  • contain spaces
  • begin with -

This resulted in unnecessary quotes around the arg value passed to cpp-linter (--ignore="build") which was causing the undesirable behavior in both #323 and #323.

After testing this in the test repo, it looks like the best way is

-    --extra-args="${{ inputs.extra-args }}"
+    '--extra-args=${{ inputs.extra-args }}'

Nushell will now pass the entire string ('--extra-arg=${{ inputs.extra-arg }}') as 1 arg to cpp-linter. Any space(s) are included as part of the arg value (as intended). For example:

  • --extra-arg=-std=c++14 -Wall invokes clang-tidy --extra-arg=-std=c++14 --extra-arg=-Wall

Note

In the cpp-linter source, the extra-arg value is stripped of surrounding quotes because bash and pwsh have very different behavior in each.

This pattern also supports values that might begin with - or be an empty string. For example:

  • --style= disables clang-format (as intended)
  • --tidy-checks=-* disables clang-tidy (as intended)
  • --tidy-checks= uses .clang-tidy file (as instended) if present

For the ignore* inputs, the quotes were causing paths to not match the discovered paths/files in a user's project. In cpp-linter source, there is some stripping of space(s), but there is no stripping of quotes. This is intended to allow users to specify patterns like so:

    with:
      ignore: >-
        | build
        | ! src

which is behaviorally equivalent to

    with:
      ignore: '|build|!src'

Summary by CodeRabbit

  • Bug Fixes

    • Improved cpp-linter argument handling for consistent cross-shell parsing of style, check, ignore, verbosity, change-only, thread-comment, summary, job and annotation options.
  • Chores

    • Workflow dependency install now excludes development packages and uses a safer link-mode to reduce install size and conflicts.

@2bndy5 2bndy5 requested a review from a team as a code owner August 29, 2025 03:00
@2bndy5 2bndy5 requested review from shenxianpeng and removed request for a team August 29, 2025 03:00
@2bndy5 2bndy5 added the bug Something isn't working label Aug 29, 2025
Copy link
Contributor

github-actions bot commented Aug 29, 2025

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v12.0.0) reports: 2 file(s) not formatted
  • docs/examples/demo/demo.cpp
  • docs/examples/demo/demo.hpp
clang-tidy (v12.0.0) reports: 7 concern(s)

Have any feedback or feature suggestions? Share it here.

Copy link
Contributor

coderabbitai bot commented Aug 29, 2025

Walkthrough

Updates action.yml: adds --no-dev to the uv sync step and standardizes construction/quoting of the uv run cpp-linter arguments into uniform single-string tokens (no functional flag order/content changes).

Changes

Cohort / File(s) Summary
Workflow dependency install (uv sync)
action.yml
Added --no-dev to uv sync args for the action project group.
cpp-linter run arg formatting (Nu / uv run)
action.yml
Reformatted the uv run args array for cpp-linter to use uniform single-quoted string tokens; preserved flag content and order (style, extensions, tidy-checks, repo-root, version, verbosity, lines/files-changed-only, thread-comments, no-lgtm, step-summary, ignore/ignore-tidy/ignore-format, database, file-annotations, extra-arg, tidy-review, format-review, passive-reviews, jobs).

Sequence Diagram(s)

sequenceDiagram
  participant GHA as GitHub Actions Runner
  participant UV as uv (Nu)
  participant LINT as cpp-linter

  GHA->>UV: sync --project <action_path> --group action --no-dev
  Note right of UV #f8f0e6: install deps without dev packages

  GHA->>UV: run cpp-linter [ 'style=...', 'extensions=...', 'tidy-checks=...', ... ]
  Note right of GHA #eef6f2: args normalized as single-string tokens

  UV->>LINT: spawn cpp-linter with provided args
  LINT-->>GHA: produce analysis results, annotations, summaries
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Assessment against linked issues

Objective Addressed Explanation
Fix unexpected inclusion of ignored source paths due to argument parsing/quoting (#321) Quoting/formatting for ignore changed; no proof in diff that path-parsing logic or splitting behavior that caused the bug is fixed.
Ensure clang-tidy can be disabled via tidy-checks: '-*' (#323) --tidy-checks token formatting was standardized but there is no change to runtime conditional logic that suppresses clang-tidy invocations.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Added --no-dev to uv sync (action.yml) Changes dependency install scope; not related to path filtering or clang-tidy enable/disable requirements from the linked issues.

Possibly related PRs

Suggested labels

minor

Suggested reviewers

  • shenxianpeng

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b4cddeb and 16f5b85.

📒 Files selected for processing (1)
  • action.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • action.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: test (windows-latest, 10)
  • GitHub Check: test (windows-latest, 18)
  • GitHub Check: test (macos-latest, 14)
  • GitHub Check: test (macos-latest, 9)
  • GitHub Check: test (ubuntu-latest, 19)
  • GitHub Check: test (ubuntu-latest, 14)
  • GitHub Check: test (ubuntu-latest, 12)
  • GitHub Check: test (macos-latest, 14)
  • GitHub Check: test (ubuntu-latest, 19)
  • GitHub Check: test (ubuntu-latest, 20)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-passing-inputs

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
action.yml (2)

396-396: Align --extensions with the “single token” pattern.

Not critical for commas, but this prevents any stray whitespace/newline surprises and matches the PR’s goal.

-          --extensions '${{ inputs.extensions }}'
+          '--extensions=${{ inputs.extensions }}'

395-415: Avoid embedding GitHub-rendered values inside single-quoted literals; prefer Nu interpolation to dodge quote-escape pitfalls.

If a user ever supplies a single quote character, it breaks the Nu literal. Build tokens via variables and Nu’s $"--flag=($val)" interpolation so Nu handles quoting.

Example pattern (illustrative; feel free to apply selectively to the “equals” args):

-        let args = [
-          '--style=${{ inputs.style }}'
-          '--tidy-checks=${{ inputs.tidy-checks }}'
-          '--ignore=${{ inputs.ignore }}'
-          '--ignore-tidy=${{ inputs.ignore-tidy }}'
-          '--ignore-format=${{ inputs.ignore-format }}'
-          '--extra-arg=${{ inputs.extra-args }}'
-        ]
+        let style = '${{ inputs.style }}'
+        let tidy_checks = '${{ inputs.tidy-checks }}'
+        let ignore = '${{ inputs.ignore }}'
+        let ignore_tidy = '${{ inputs.ignore-tidy }}'
+        let ignore_format = '${{ inputs.ignore-format }}'
+        let extra_args = '${{ inputs.extra-args }}'
+        let args = [
+          $"--style=($style)"
+          $"--tidy-checks=($tidy_checks)"
+          $"--ignore=($ignore)"
+          $"--ignore-tidy=($ignore_tidy)"
+          $"--ignore-format=($ignore_format)"
+          $"--extra-arg=($extra_args)"
+        ]
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 18f7429 and e89b4fb.

📒 Files selected for processing (1)
  • action.yml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: 2bndy5
PR: cpp-linter/cpp-linter-action#314
File: action.yml:394-416
Timestamp: 2025-08-17T12:34:25.463Z
Learning: The cpp-linter/cpp-linter-action repository manages the downstream parsing of command-line arguments through their own cpp-linter/cpp-linter project, so passing empty string values for flags like --extra-arg="" is acceptable and known to work in their implementation.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: test (windows-latest, 14)
  • GitHub Check: test (windows-latest, 18)
  • GitHub Check: test (windows-latest, 12)
  • GitHub Check: test (windows-latest, 17)
  • GitHub Check: test (windows-latest, 10)
  • GitHub Check: test (windows-latest, 16)
  • GitHub Check: test (macos-latest, 16)
  • GitHub Check: test (windows-latest, 8)
  • GitHub Check: test (ubuntu-latest, 20)
  • GitHub Check: test (ubuntu-latest, 19)
  • GitHub Check: test (ubuntu-latest, 17)
  • GitHub Check: test (windows-latest, 16)
  • GitHub Check: test (windows-latest, 11)
  • GitHub Check: test (windows-latest, 20)
  • GitHub Check: test (macos-latest, 20)
  • GitHub Check: test (macos-latest, 16)
  • GitHub Check: test (macos-latest, 12)
  • GitHub Check: test (macos-latest, 11)
🔇 Additional comments (2)
action.yml (2)

372-376: Good call adding --no-dev to uv sync.

Cuts install time and avoids pulling dev deps into the runner.


411-411: Nice: single-token --extra-arg form matches Nu parsing and cpp-linter’s internal splitting.

This resolves the spaces/leading-hyphen issues from the linked bugs.

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Aug 29, 2025

Nushell will now pass the entire string ('--extra-arg=${{ inputs.extra-arg }}') as 1 arg to cpp-linter

BTW, this makes nushell syntax feel more like a programming language in which each specified arg (passed to an external binary executable) is not reinterpreted by the shell. 👍🏼

Copy link
Collaborator

@shenxianpeng shenxianpeng left a comment

Choose a reason for hiding this comment

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

🚀👏

@2bndy5
Copy link
Collaborator Author

2bndy5 commented Aug 29, 2025

I've tested this pretty diligently. I'm confident enough to merge and release ASAP.

@2bndy5 2bndy5 merged commit b533471 into main Aug 29, 2025
84 checks passed
@2bndy5 2bndy5 deleted the fix-passing-inputs branch August 29, 2025 05:57
@shenxianpeng

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clang-tidy cannot be disabled since v2.16.1 unexpected source files has been included
2 participants