Moved Git hooks to the .githooks directory, and created make init script.
This commit is contained in:
parent
ec4694070e
commit
b5d69ff010
3 changed files with 22 additions and 2 deletions
12
.githooks/pre-commit
Executable file
12
.githooks/pre-commit
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Check if fix-whitespace is installed, and if so, run it.
|
||||
#
|
||||
|
||||
if ! command -v fix-whitespace &> /dev/null
|
||||
then
|
||||
echo "fix-whitespace could not be found"
|
||||
exit
|
||||
else
|
||||
fix-whitespace --check
|
||||
fi
|
5
Makefile
5
Makefile
|
@ -28,6 +28,11 @@ SEDI := sed -i
|
|||
endif
|
||||
|
||||
|
||||
# Configure the repository to use .githooks
|
||||
init:
|
||||
git config core.hooksPath .githooks
|
||||
|
||||
|
||||
# Build PLFA web version and test links
|
||||
default: test
|
||||
|
||||
|
|
|
@ -143,15 +143,17 @@ You'll see the key sequence of the character in mini buffer.
|
|||
PLFA is available as both a website and an EPUB e-book, both of which can be built on Linux and macOS.
|
||||
PLFA is written in literate Agda with [Kramdown Markdown][kramdown].
|
||||
|
||||
|
||||
### Git hooks
|
||||
|
||||
The repository comes with several pre-commit Git hooks installed:
|
||||
The repository comes with several Git hooks:
|
||||
|
||||
1. The [fix-whitespace][fix-whitespace] program is run to check for whitespace violations.
|
||||
|
||||
2. The test suite is run to check if everything type checks.
|
||||
|
||||
If you don’t have [fix-whitespace][fix-whitespace] installed, you can circumvent the pre-commit Git hooks by passing `--no-verify`.
|
||||
You can install these Git hooks by calling `make init`.
|
||||
|
||||
|
||||
### Building the website
|
||||
|
||||
|
@ -198,6 +200,7 @@ bundle install
|
|||
bundle exec jekyll serve
|
||||
```
|
||||
|
||||
|
||||
### Building the EPUB
|
||||
|
||||
The [EPUB version][epub] of the book is built using Pandoc.
|
||||
|
|
Loading…
Reference in a new issue