Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
WGUNDERWOOD committed Jan 12, 2025
2 parents ea496d3 + f2d256d commit bcefeaa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- id: tex-fmt
name: Format LaTeX files
language: rust
entry: tex-fmt
args: [--fail-on-change]
files: \.(tex|bib|cls|sty)$
stages: [pre-commit, pre-merge-commit, pre-push, manual]
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,31 @@ A man page can be generated at run-time using the
[man](https://github.com/WGUNDERWOOD/tex-fmt/tree/main/man)
directory for more details.

### Pre-commit hook

You can format your LaTeX files before every commit using
[pre-commit](http://pre-commit.com) with the following `.pre-commit-config.yaml`
in your repository root:

```yaml
repos:
- repo: https://github.com/WGUNDERWOOD/tex-fmt
rev: v0.5.3
hooks:
- id: tex-fmt
```
If you don't only want to prevent committing on unformatted
documents but don't want them automatically formatted, add:
```yaml
- id: tex-fmt
args: [--check]
```
For more on how to use pre-commit check out their
[quick start guide](https://pre-commit.com/#quick-start)!
## Performance
When formatting all of the test cases,
Expand Down

0 comments on commit bcefeaa

Please sign in to comment.