This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix clang tidy provider when multiple config files exist in directory tree
ClosedPublic

Authored by njames93 on Feb 6 2021, 7:26 AM.

Details

Summary

Currently Clang tidy provider searches from the root directory up to the target directory, this is the opposite of how clang-tidy searches for config files.
The result of this is .clang-tidy files are ignored in any subdirectory of a directory containing a .clang-tidy file.

Diff Detail

Event Timeline

njames93 created this revision.Feb 6 2021, 7:26 AM
njames93 requested review of this revision.Feb 6 2021, 7:26 AM
njames93 updated this revision to Diff 321937.Feb 6 2021, 7:28 AM

Newline at eof.

njames93 added a comment.EditedFeb 6 2021, 7:48 AM

I have made an extra test case that compares the output of our provider to the output of a clang::tidy::FileOptionsProvider, This would ensure coherent behaviour between our implementation and clang-tidy implementation.
However I'm not sure it should be included as any changes made on the clang tidy side may break that test and we shouldn't be enforcing clang-tidy maintainers to also ensure compliance with clangd.

@sammccall I meant to ping this one sorry.

sammccall accepted this revision.Feb 12 2021, 8:46 AM

Sorry about dropping this (and others, i'm trying to get through them now)

Agree about cherrypicking this.

Regarding the extra test case... I'm not sure either. It's a nice test, but the conceptual dependency is annoying.
If it's simple enough, feel free to add it and we can remove if it causes problems.

This revision is now accepted and ready to land.Feb 12 2021, 8:46 AM
njames93 edited the summary of this revision. (Show Details)Feb 12 2021, 8:54 AM