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

Use a clang-format file that isn't at the root of the repo #59

Open
Ryanf55 opened this issue Mar 8, 2023 · 0 comments
Open

Use a clang-format file that isn't at the root of the repo #59

Ryanf55 opened this issue Mar 8, 2023 · 0 comments

Comments

@Ryanf55
Copy link

Ryanf55 commented Mar 8, 2023

          > For clang-format, with a `.clang-format` file in the base of your repo:
  - repo: https://github.com/pocc/pre-commit-hooks
    rev: v1.3.5
    hooks:
      - id: clang-format
        args: [-i, --style=file]

Thanks for your reply. I will try it.

Originally posted by @sangshuduo in #50 (comment)

Clang-format has a limitation that it only looks in the current director, or above it, when searching for a config file.

I have multiple repositories, A, B, and C.
A and B have source code.
C has common configuration including the clang-format file, which is shared with B and C.

Latest clang-format has support for this: https://stackoverflow.com/a/70859277/11032285

Is there anything that I should do to use that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant