Skip to content

Commit

Permalink
Add pre-commit configuration example
Browse files Browse the repository at this point in the history
Add pre-commit configuration in `.pre-commit-config.yaml` and updated
the `README.rst`.

Signed-off-by: Roald Nefs <info@roaldnefs.com>
  • Loading branch information
roaldnefs committed Apr 5, 2019
1 parent e33d187 commit ba35c06
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

# For use with pre-commit.
# See usage instructions at http://pre-commit.com

- id: salt-lint
name: Salt-lint
description: This hook runs salt-lint.
entry: salt-lint
language: python
files: \.(sls)$

21 changes: 21 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,32 @@ Salt-lint supports local confguration via a ``.salt-lint`` configuration file. S

If a value is provided on both the command line and via a config file, the values will be merged (if a list like **exclude_paths**), or the **True** value will be preferred, in the case of something like **quiet**.

Pre-commit Setup
----------------

To use salt-lint with `pre-commit`_, just add the following to your local repo's ``.pre-commit-config.yaml`` file. Prior to version 0.12.0 of `pre-commit`_ the file was ``hooks.yaml`` (now ``.pre-commit-config.yaml``).

.. code-block:: yaml
---
# For use with pre-commit.
# See usage instructions at http://pre-commit.com
- id: salt-lint
name: Salt-lint
description: This hook runs salt-lint.
entry: salt-lint
language: python
files: \.(sls)$
Authors
=======

salt-lint is heavily based on `ansible-lint`_ with the modified work by `Roald Nefs`_. `ansible-lint`_ was created by `Will Thames`_ and is now maintained as part of the `Ansible`_ by `Red Hat`_ project.

.. _pre-commit: https://pre-commit.com
.. _ansible-lint: https://github.com/ansible/ansible-lint
.. _Roald Nefs: https://github.com/roaldnefs
.. _Will Thames: https://github.com/willthames
Expand Down

0 comments on commit ba35c06

Please sign in to comment.