Skip to content

.clang-format-ignore is not reusableΒ #158538

@JVApen

Description

@JVApen

This is a split off from clangd/clangd#2476 (comment)
Users of clangd want to indicate that new files are formatted and old files are left alone.

Clang-format 18 added support for .clang-format-ignore and clang 20 fixed issues and added blob support regarding it. Unfortunately, most/all of the code of this feature is directly called from the main function instead of being part of the format library. As such, this feature is only available when using the clang-format executable and not when doing formatting any other way, like clangd does.

Given that it is called directly before clang::format::format(FileName, FailOnIncompleteFormat);, this should easily be moved inside that function.

A concern:

  • can we apply this to every format or should it be optional to ignore this 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