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

Cannot find clang-format-diff #29

Open
Smeegol opened this issue Sep 7, 2021 · 3 comments
Open

Cannot find clang-format-diff #29

Smeegol opened this issue Sep 7, 2021 · 3 comments

Comments

@Smeegol
Copy link

Smeegol commented Sep 7, 2021

OS: macOS 11.5.2
clang-format version 12.0.1, installed by Homebrew
But, error while using it:

$ ./scripts/apply-format -i --staged
Cannot find clang-format-diff which should be shipped as part of the same
package where clang-format is.

Please find out where clang-format-diff is in your distro and report an issue
at https://github.com/barisione/clang-format-hooks/issues with details about
your operating system and setup.

You can also specify your own path for clang-format-diff by setting the
$CLANG_FORMAT_DIFF environment variable, for instance:

    CLANG_FORMAT_DIFF="python /.../clang-format-diff.py" \
        ./scripts/apply-format
@barisione
Copy link
Owner

Any idea where it's actually installed?

What do these say:

ls -l $(which -a clang-format)

and:

find /usr/local/ -name clang-format-diff*

@Smeegol
Copy link
Author

Smeegol commented Sep 7, 2021

@barisione

$ ls -l $(which -a clang-format)
lrwxr-xr-x  1 smeegol  admin  46 Sep  7 10:32 /opt/homebrew/bin/clang-format -> ../Cellar/clang-format/12.0.1/bin/clang-format
$ find /usr/local/ -name clang-format-diff*
zsh: no matches found: clang-format-diff*

@jamiebullock
Copy link

You need to set the CLANG_FORMAT_DIFF environment variable to tell the script where to look. e.g.

export CLANG_FORMAT_DIFF="python3 /opt/homebrew/Cellar/clang-format/15.0.7/share/clang/clang-format-diff.py"

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

3 participants