Skip to content

Commit ece9c5d

Browse files
paulhfischersbarzowski
authored andcommitted
updated pre-commit config and readme
1 parent 1b7cbff commit ece9c5d

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.pre-commit-hooks.yaml

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
# How to use pre-commit hook: https://pre-commit.com
21
- id: jsonnet-format
3-
name: Format fix for jsonnet/libsonnet files
4-
entry: jsonnetfmt -i
2+
name: jsonnetfmt
3+
description: Automatically format jsonnet files.
4+
entry: jsonnetfmt
5+
args: [-i]
56
language: golang
6-
files: '\.(jsonnet|libsonnet)$'
7-
additional_dependencies: [ "github.com/google/go-jsonnet/cmd/jsonnetfmt" ]
7+
files: \.(jsonnet|libsonnet)$
8+
minimum_pre_commit_version: 2.10.1
9+
- id: jsonnet-lint
10+
name: jsonnet-lint
11+
description: Lint jsonnet files.
12+
entry: jsonnet-lint
13+
language: golang
14+
files: \.(jsonnet|libsonnet)$
15+
minimum_pre_commit_version: 2.10.1

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ It's also available on Homebrew:
2525
brew install go-jsonnet
2626
```
2727

28+
`jsonnetfmt` and `jsonnet-lint` are also available as [pre-commit](https://github.com/pre-commit/pre-commit) hooks. Example `.pre-commit-config.yaml`:
29+
```yaml
30+
- repo: https://github.com/google/go-jsonnet
31+
rev: # ref you want to point at, e.g. v0.17.0
32+
hooks:
33+
- id: jsonnet-format
34+
- id: jsonnet-lint
35+
```
36+
2837
## Build instructions (go 1.11+)
2938
3039
```bash

0 commit comments

Comments
 (0)