Alternative path to .clang-format file?

for reasons that are out of my control, the primary .clang-format file that I’d like to use with my project is stored in a subdirectory. Short of just symlinking and ignoring at the root folder, is there any way to configure clangd to use a specific .clang-format file (not located in the root) for its formatting settings?

1 Like

It’s an old topic but maybe someone will find it useful.
Since recently (release 14 if I remember correctly), clang-format does what you want:

When using -style=file:<format_file_path>, clang-format for each input file will use the format file located at <format_file_path>. The path may be absolute or relative to the working directory.

See Clang-Format Style Options — Clang 18.0.0git documentation.

Thanks. It works for the clang-format executable.

But I did not found a similar option for clangd.
Do you know a way to pass to clangd the same option?