browbeat/.pre-commit-config.yaml
agopi 4969f31ce1 Update ansible-lint execution
Updated ansible-lint to run via pre-commit only on ansible files.

Moved config file to its standard location, repository root, which
simplifies syncronization and usage.

Contains bumping ansible-lint to current version which also required
adding few more rule excludes. These excludes are going to be removed
one by one in follow-up changes. This gradual approach allow us to
improve code style without endless merge conflicts.

Config settings mostly based on those used by tripleo repos.

Bumping linters can now be done by running 'pre-commit autoupdate'.

Pro-commit always locks versions so there is no chance that a newer
linter (ansible-lint) would break CI.

Some documentation can be found at https://github.com/openstack/tripleo-quickstart/blob/master/doc/source/contributing.rst
and applies mostly to any project using pre-commit.

Co-Authored-By: Sorin Sbarnea <ssbarnea@redhat.com>
Change-Id: I05eb561c4e353b5fe0bc7c6d3ab2f8ea6c6ea2f4
2019-01-29 18:36:59 +00:00

18 lines
468 B
YAML

---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- repo: https://github.com/ansible/ansible-lint
rev: v4.0.1
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
exclude: ^rally/
entry: ansible-lint --force-color -v