Skip to content

tools: fix cpplint false positive for v8::FastApiCallbackOptions&#62585

Open
DivyanshuX9 wants to merge 1 commit intonodejs:mainfrom
DivyanshuX9:fix/cpplint-v8-fast-api-callback-options
Open

tools: fix cpplint false positive for v8::FastApiCallbackOptions&#62585
DivyanshuX9 wants to merge 1 commit intonodejs:mainfrom
DivyanshuX9:fix/cpplint-v8-fast-api-callback-options

Conversation

@DivyanshuX9
Copy link
Copy Markdown

i am trying to overcome this issue , #45761

My change Summary

cpplint's runtime/references rule flags non-const reference parameters
as a style violation. However, v8::FastApiCallbackOptions& is part of
V8's Fast API contract , its signature is defined by V8 and Node.js has
no control over it. This causes a false positive.

Changes

Patched CheckForNonConstReference in tools/cpplint.py to recognise
v8::FastApiCallbackOptions& as a known V8 Fast API type that
legitimately requires a non-const reference, and skip the warning for it.

Testing

Ran cpplint with --filter=+runtime/references against a test file
containing both patterns:

  • v8::FastApiCallbackOptions& options → no warning (false positive suppressed)
  • int& value → still flagged (rule intact for legitimate cases )

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Apr 4, 2026
@DivyanshuX9
Copy link
Copy Markdown
Author

Hi @Rtrott @targos , Sir would you plz review when you get a chance. This is a small fix to suppress a cpplint false positive for v8::FastApiCallbackOptions&, which is a V8 Fast API type whose non-const reference signature is mandated by V8 itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Issues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants