Skip to content

Commit

Permalink
updated pre-commit config and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhfischer authored and sbarzowski committed May 19, 2021
1 parent 1b7cbff commit ece9c5d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .pre-commit-hooks.yaml
@@ -1,7 +1,15 @@
# How to use pre-commit hook: https://pre-commit.com
- id: jsonnet-format
name: Format fix for jsonnet/libsonnet files
entry: jsonnetfmt -i
name: jsonnetfmt
description: Automatically format jsonnet files.
entry: jsonnetfmt
args: [-i]
language: golang
files: '\.(jsonnet|libsonnet)$'
additional_dependencies: [ "github.com/google/go-jsonnet/cmd/jsonnetfmt" ]
files: \.(jsonnet|libsonnet)$
minimum_pre_commit_version: 2.10.1
- id: jsonnet-lint
name: jsonnet-lint
description: Lint jsonnet files.
entry: jsonnet-lint
language: golang
files: \.(jsonnet|libsonnet)$
minimum_pre_commit_version: 2.10.1
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -25,6 +25,15 @@ It's also available on Homebrew:
brew install go-jsonnet
```

`jsonnetfmt` and `jsonnet-lint` are also available as [pre-commit](https://github.com/pre-commit/pre-commit) hooks. Example `.pre-commit-config.yaml`:
```yaml
- repo: https://github.com/google/go-jsonnet
rev: # ref you want to point at, e.g. v0.17.0
hooks:
- id: jsonnet-format
- id: jsonnet-lint
```

## Build instructions (go 1.11+)

```bash
Expand Down

0 comments on commit ece9c5d

Please sign in to comment.