Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify .clang-format and .clang-tidy file location #805

Open
xinnjie opened this issue Jun 24, 2021 · 5 comments
Open

Specify .clang-format and .clang-tidy file location #805

xinnjie opened this issue Jun 24, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@xinnjie
Copy link

xinnjie commented Jun 24, 2021

In our team, we have many repo( one server per repo). All repo format is suggested to be same. Instead of put one .clang-format/.clang-tidy in each repo, specify .clang-format and .clang-tidy is more convenient.

@xinnjie xinnjie added the enhancement New feature or request label Jun 24, 2021
@njames93
Copy link

Clangd will recursive go up the directory tree looking for those config files, so you could just put them in the root directory above all your repos.

@HighCommander4
Copy link

Possibly relevant: https://reviews.llvm.org/D72326

@definelicht
Copy link

This would be very useful; .clang-tidy supports the --config-file option, so either an equivalent to this or a way to forward flags to clang-tidy would provide this feature

@njames93
Copy link

njames93 commented Jul 18, 2022

@sam-mccall If we were to support something like this, How would you want to specify a --config-file option.
I feel like we can rule out a command line flag off the bat, despite it being the easiest implementation.
Putting it in the config sounds kind of ideal, but I feel there's definitely gonna be some hurdles in the implementation of that if we try and match how clang-tidy handles the flag. The main one is that if the config file loaded has InheritParentConfig enabled, we then fallback to loading file relative .clang-tidy config files.
We'd also likely want to use a FileCache for tracking any changes to the file.

@voertler
Copy link

What is the status of this? For clang-format the straight forward solution would be to implement the --style option.

WilliamHsieh added a commit to WilliamHsieh/dotfiles that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants