Skip to content

Add option to set default header language #137792

Open
@oncipriani

Description

@oncipriani

When .clang-format includes the setting Language: C, clang-format do not format header files (.h) and displays the message Configuration file(s) do(es) not support C++.

Adding // clang-format Language: C to the beginning of the header files solves the problem and the headers are formatted as expected, but this should be considered a workaround.

There should be an option for telling clang-format to treat all header files as C in order to prevent having to add the comment to all header files. In addition, the default language for header files should match the language set in the .clang-format file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions