Skip to content

tools: add check for directives styling

Updated the C++ linter to check for preprocessor directive styling and updated files to conform to the new styling rules. The chosen styling rules are as follows;

  1. No space between # and the directive.
  2. Use one whitespace between define and the identifier.
  3. No space between defined and the open parenthesis in #if defined(XYZ).
  4. Use one whitespace between undef and the identifier.
  5. Consistent indentation in if/ifdef/ifndef blocks

Fixes: https://github.com/nodejs/node/issues/28605

Checklist

Merge request reports

Loading