Metadata-Version: 2.1
Name: pre-commit-k8s
Version: 0.0.3
Summary: pre-commit rules for Kubernetes related files
Home-page: https://github.com/zwennesm/pre-commit-k8s
Author: Martijn Zwennes
Author-email: martijnzwennes@pm.me
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# pre-commit-k8s

An additional hook that can be used as a hook with [pre-commit](https://pre-commit.com/) to validate Kubernetes objects.

Current hooks:

* `kubernetes-secrets` - check if secrets are pushed

## Usage

Install pre-commit

```
pip install pre-commit
```

Setup the `.pre-commit-config.yaml` config file:

```
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/zwennesm/pre-commit-k8s
  rev: master
  hooks:
  - id: pre-commit-k8s
    entry: pre-commit-k8s
```

Install the pre-commit hooks:

```
pre-commit install
```

## Local install

Alternatively `pre-commit-k8s` can be installed locally for testing.

```
pip install pre-commit-k8s
```

`pre-commit-k8s` expects a list of files to be passed to it:

```
➜ pre-commit-k8s LICENCE                                          
2020-12-07 14:50:06,636 - INFO - Validating the following rules:
2020-12-07 14:50:06,636 - INFO - ✓ Kubernetes Secret check
2020-12-07 14:50:06,636 - INFO - No validation errors found
```

Rules can also be excluded:

```
➜ pre-commit-k8s --exclude kubernetes-secrets kubernetes-secret.yaml 
2020-12-07 14:52:08,569 - WARNING - No rules activated to validate files
2020-12-07 14:52:08,569 - INFO - No validation errors found
```


