Skip to content

chore(lint): ban decayed array parameters - #3236

Merged
zackees merged 1 commit into
masterfrom
feat/3233-array-param-lint
Jun 18, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/3233-array-param-lint

Conversation

@zackees

@zackees zackees commented Jun 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Add ci/tools/check_array_params.py, a clang-query-backed ratchet for function parameters spelled as C arrays (T value[N] / T value[]).
  • Wire the checker into the unified C++ linter in full-repo and single-file modes with a checked-in baseline for existing debt.
  • Update CodeRabbit and FastLED agent review guidance so reviews apply the same ISR vs non-ISR replacement policy.

Closes #3233

Follow-up filed while implementing: #3234 audits whether set_input_gamut(DiodeProfile* profile, ...) should keep mutable pointer semantics or move to references.

Verification

  • uv run pytest ci/tools/test_check_noexcept.py ci/tools/test_check_array_params.py -q
  • uv run python ci/tools/check_array_params.py --scope all
  • git diff --check
  • Temporary probe: changed an existing baseline signature from white_xy[2] to white_xy[3]; uv run python ci/lint_cpp/run_all_checkers.py src/fl/gfx/rgbw.h failed with ArrayParamAstChecker, then the probe was reverted.
  • uv run python ci/lint_cpp/run_all_checkers.py src/fl/gfx/rgbw.h
  • bash lint
  • bash test --cpp (330/330 passed)

Add a clang-query-backed ratchet for function parameters spelled as C arrays, including ISR-specific diagnostics and a checked-in baseline for existing debt.

Update CodeRabbit and FastLED agent review guidance to use array references for ISR APIs and span or array references elsewhere.

Closes #3233
@coderabbitai

coderabbitai Bot commented Jun 18, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/3233-array-param-lint

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 commented Jun 18, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{}

@zackees
zackees merged commit 3d15703 into master Jun 18, 2026
10 checks passed
@zackees
zackees deleted the feat/3233-array-param-lint branch June 18, 2026 21:52
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

chore(lint): ban decayed C array parameters with clang-query

1 participant