Skip to content
Snippets Groups Projects
Commit 8a20e758 authored by nimrod's avatar nimrod
Browse files

Pre-commit hook.

So now it can be used as a pre-commit hook, validating and nicely
formatting YAML files. Hurray!
parent fea7204d
No related branches found
No related tags found
No related merge requests found
Pipeline #2549 failed
......@@ -2,6 +2,8 @@
include:
- project: shore/ci-stuff
file: templates/pre-commit.yml
- project: shore/ci-stuff
file: templates/pre-commit-repo.yml
- project: shore/ci-stuff
file: templates/python.yml
......
......@@ -96,3 +96,8 @@ repos:
rev: '0.47'
hooks:
- id: check-manifest
- repo: https://github.com/pre-commit/pre-commit.git
rev: v2.15.0
hooks:
- id: validate_manifest
---
- id: yamltool
name: YAML tool
description: Validate and pretty-print YAML files.
language: python
entry: yt
args: ["--in-place"]
types: [yaml]
include *.rst
include *.txt
exclude .pre-commit-config.yaml
exclude .pre-commit-hooks.yaml
exclude .gitlab-ci.yml
exclude .gitignore
......@@ -39,6 +39,21 @@ Usage
Please note that specifying multiple input files will concatenate
them, resulting in a single file that has multiple documents.
pre-commit hook
---------------
YAML tool can be used as a `pre-commit <https://pre-commit.com/>` hook by
adding the following to your :code:`.pre-commit-config.yaml` file:
.. code:: yaml
---
repos:
- repo: https://git.shore.co.il/nimrod/yamltool.git
rev: 0.1.0 # Check for the latest tag or run pre-commit autoupdate.
hooks:
- id: yamltool
License
-------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment