Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pre-commit-hooks and docs #475

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
- id: kube-linter
name: KubeLinter
description: This hook installs (using Go) and runs the KubeLinter utility to lint Helm charts and Kubernetes YAML files.
entry: kube-linter
entry: kube-linter lint
language: golang
types: [yaml]

- id: kube-linter-system
name: KubeLinter System
description: This hook runs the KubeLinter utility that exists already on the system to lint Helm charts and Kubernetes YAML files.
entry: kube-linter
entry: kube-linter lint
language: system
types: [yaml]

Expand All @@ -17,4 +17,4 @@
description: This hook runs kube-linter using the project's official docker image
language: docker_image
types: [yaml]
entry: stackrox/kube-linter:0.2.6
entry: stackrox/kube-linter:0.2.6 lint
23 changes: 9 additions & 14 deletions docs/using-kubelinter.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,15 @@ kube-linter lint /path/to/directory/containing/Chart.yaml-file/

If you are using the [pre-commit framework](https://pre-commit.com/) for
managing Git pre-commit hooks, you can install and use KubeLinter as a
pre-commit hook. To do this:

1. Download the [`.pre-commit-hooks.yaml`](https://raw.githubusercontent.com/stackrox/kube-linter/main/.pre-commit-hooks.yaml)
file in the Git repository in which you want to install the KubeLinter
pre-commit hooks:
```bash
curl -O https://raw.githubusercontent.com/stackrox/kube-linter/main/.pre-commit-hooks.yaml
```
1. Run the `pre-commit install` command:
```bash
pre-commit install
```
1. After installation, the KubeLinter pre-commit hooks run whenever you run the
`git commit` command.
pre-commit hook. To do this, add the following to your `.pre-commit-config.yaml`:

```yaml
- repo: https://github.com/stackrox/kube-linter
rev: 0.6.0 # kube-linter version
hooks:
# You can change this to kube-linter-system or kube-linter-docker
- id: kube-linter
```

The [`.pre-commit-hooks.yaml`](https://raw.githubusercontent.com/stackrox/kube-linter/main/.pre-commit-hooks.yaml)
includes the following pre-commit hooks:
Expand Down