Skip to content

Commit 2942963

Browse files
committed
Merge branch 'main' into ek
2 parents 77ea801 + 9cc89b2 commit 2942963

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This is BibTags, a BibTeX library that contains many curated literature referenc
1616
6. Commit and push your changes
1717
7. Make a pull request to the original repo, which will be reviewed by an ISF member
1818

19+
*Life hack: Enable a pre-commit hook to enforce steps 4 and 5 (see below).*
20+
1921
## Sorting Order
2022
Entries and their fields are sorted by the `sort` script.
2123
- Entries are sorted by
@@ -145,6 +147,37 @@ The script can be configured using the following files
145147
```
146148
- `scripts/test/config_string.yaml`: Declares which fields should contain bibtex strings instead of literals.
147149
150+
### Good practice: Check locally
151+
152+
To detect typical problems, running `./run sort` and `./run test` are crucial.
153+
By default, you have to manually remember to do this, which is easy to forget.
154+
You can optionally enable a pre-commit hook that always performs certain checks locally before allowing a commit.
155+
There are several options:
156+
157+
- Check for sorting + test literature (this effectively executes the CI pipeline locally):
158+
```
159+
echo '#!/usr/bin/env sh
160+
set -e
161+
./run sorted
162+
./run test' > .git/hooks/pre-commit
163+
chmod +x .git/hooks/pre-commit
164+
```
165+
- Check for sorting only (this runs much faster than the previous option, but won't catch all mistakes):
166+
```
167+
echo '#!/usr/bin/env sh
168+
set -e
169+
./run sorted' > .git/hooks/pre-commit
170+
chmod +x .git/hooks/pre-commit
171+
```
172+
- To completely disable local checking again (the default state):
173+
```
174+
rm -f .git/hooks/pre-commit
175+
```
176+
- To skip checking only on a single commit, run:
177+
```
178+
git commit --no-verify
179+
```
180+
148181
## Troubleshooting
149182
150183
- If you encounter the error message `short-natbib bibtex (Run 1/2)...fail` without any further error messages, try to clear the biber cache:

0 commit comments

Comments
 (0)