Skip to content

clang-tidy does not complain about missing commas in config file #53737

Closed
@tpudlik

Description

@tpudlik

The following .clang-tidy file will enable certain checks:

---
Checks: >
    bugprone-argument-comment,
    bugprone-assert-side-effect,
    bugprone-bool-pointer-implicit-conversion,
...

The following .clang-tidy file (missing the trailing commas) will enable no checks, but clang-tidy will not complain:

---
Checks: >
    bugprone-argument-comment
    bugprone-assert-side-effect
    bugprone-bool-pointer-implicit-conversion
...

It is easy to forget to add a trailing comma in a long list, accidentally disabling checks (real-world example). Clang-tidy should perform some validation of the config to catch such bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorclang-tidy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions