Skip to content

Commit e0c4f84

Browse files
committed
Add pre-commit config for additional linting checks
1 parent d7f6acc commit e0c4f84

3 files changed

Lines changed: 31 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,29 @@ true
2323

2424
The origin of this project comes from [`julia#38841`](https://github.com/JuliaLang/julia/issues/38841).
2525

26+
## Development
27+
28+
Ensure you have both [UV](https://github.com/astral-sh/uv) and [Just](https://github.com/casey/just).
29+
30+
To run unit tests, simply run:
31+
32+
```commandline
33+
$ just test
34+
# ...
35+
```
36+
37+
We use UV to conveniently run pre-commit:
38+
39+
```commandline
40+
$ just fmt
41+
```
42+
43+
In order to commit, you will want to ensure pre-commits are installed:
44+
45+
```commandline
46+
$ uvx pre-commit install
47+
```
48+
2649
## Citation
2750

2851
If your research depends on HiddenFiles.jl, please consider giving us a formal citation: [`citation.bib`](./citation.bib).

justfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,18 @@ run run_file:
3333
julia --project={{project_dir}} {{run_file}}
3434

3535
# Generate documentation
36-
[group: 'ci']
3736
docs: (instantiate-dev docs_dir)
3837
julia --project={{docs_dir}} {{docs_mk_file}}
3938

4039
# Benchmark performance
41-
[group: 'ci']
4240
bench: (instantiate-dev bench_dir)
4341
julia --project={{bench_dir}} {{bench_file}}
4442

4543
# Check formatting with blue style
46-
[group: 'ci']
4744
fmt: install-formatter
4845
# https://github.com/invenia/BlueStyle
4946
julia --project=@JuliaFormatter -e 'using JuliaFormatter; format("{{project_dir}}", style=BlueStyle())'
47+
uvx pre-commit run --all-files
5048

5149
# Install JuliaFormatter
5250
[private]
@@ -61,4 +59,3 @@ instantiate:
6159
[private]
6260
instantiate-dev dev_project_dir:
6361
julia --project={{dev_project_dir}} -e '{{dev_instantiate_code}}'
64-

0 commit comments

Comments
 (0)