[libcxx] [llvm] Add pre-commit hooks and git config for libc++ & git-clang-format. (PR #73798)

Louis Dionne via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 06:30:13 PST 2023


ldionne wrote:

Personally, I think what we want is a combination of this PR and @tru 's https://github.com/llvm/llvm-project/pull/73957.

The pre-commit hook as written in #73957 seems like a better approach since it uses exactly the same logic as the pre-commit CI, it will run Darker too, and it will work on Windows since it's Python. It's also LLVM wide instead of being libc++ specific.

However, this PR contains documentation and a script to install the pre-commit hook (which we might want to write in Python just for the sake of Windows). Personally, I think the best of all worlds would be:
1. Merge @tru 's changes to the CI script that allow it being used as a pre-commit hook
2. From this PR, move the documentation additions and the script to install hook to an LLVM wide location

That way, all of LLVM will have a nicely documented way of installing this hook, and the hook will mirror exactly what we do for all of LLVM in the pre-commit CI. That would really rock.


https://github.com/llvm/llvm-project/pull/73798


More information about the llvm-commits mailing list