Skip to content

Commit 46cac54

Browse files
committed
pre-commit: add basic checks
Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent 54f83ae commit 46cac54

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.github/workflows/java.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,22 @@ permissions:
1111
contents: read
1212

1313
jobs:
14+
pre-commit:
15+
name: Rerun pre-commit checks
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out repo
19+
uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.13'
24+
- name: Run pre-commit hooks
25+
uses: pre-commit/[email protected]
26+
1427
build:
1528
name: Build
29+
needs: pre-commit
1630
runs-on: ${{ matrix.os }}
1731
outputs:
1832
dist-base: ${{ steps.dist.outputs.dist-base }}

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# exclude vendored files
2+
exclude: '^(COPYING\.LESSER)$'
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v6.0.0
7+
hooks:
8+
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- id: check-vcs-permalinks
11+
- id: check-yaml
12+
- id: end-of-file-fixer
13+
- id: fix-byte-order-marker
14+
- id: mixed-line-ending
15+
- id: trailing-whitespace
16+
17+
- repo: https://github.com/codespell-project/codespell
18+
rev: v2.4.1
19+
hooks:
20+
- id: codespell
21+
name: Check spelling with codespell
22+
additional_dependencies:
23+
- tomli # Python < 3.11
24+
25+
- repo: meta
26+
hooks:
27+
- id: check-hooks-apply
28+
- id: check-useless-excludes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mvn
2525
The JAR will be in `target/openslide-java-*.jar`.
2626

2727
If you have multiple JVMs on your system, and Maven defaults to a version
28-
older than 22, you might need to set `JAVA_HOME`. For exmaple, on Fedora:
28+
older than 22, you might need to set `JAVA_HOME`. For example, on Fedora:
2929

3030
```
3131
JAVA_HOME=/usr/lib/jvm/java-22 mvn

0 commit comments

Comments
 (0)