-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/returntocorp/pre-commit-ocaml | ||
rev: v1.0.0 | ||
hooks: | ||
- id: ocp-indent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#! /usr/bin/env bash | ||
# | ||
# Check that the user ran the pre-commit hooks. | ||
# | ||
set -eu | ||
|
||
eval $(opam env) | ||
|
||
pre-commit install | ||
if ! pre-commit run --all; then | ||
cat <<EOF | ||
It looks like the user who committed the code did not set up their | ||
pre-commit hook. You need the following one-time setup: | ||
1. Install the 'pre-commit' command: | ||
$ pip3 install pre-commit | ||
2. Install the pre-commit hooks for the repo: | ||
$ pre-commit install | ||
3. Install ocp-indent: | ||
$ opam install ocp-indent | ||
4. To fix already committed code, run: | ||
$ pre-commit run --all | ||
EOF | ||
exit 1 | ||
fi |