From 5c013993a13d30c7caac1f849ecd6e86df639ba7 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Wed, 30 Nov 2016 19:16:50 +0200 Subject: [PATCH] - Added all scripts to pre-commit hooks. - Removed useless pre-commit checks. - Added Travis CI test, badge to README. - Added pre-commit test for outdated requirements. --- .pre-commit-config.yaml | 15 +++++++++++---- .travis.yml | 16 ++++++++++++++++ README.rst | 3 +++ requirements.txt | 3 +++ 4 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 .travis.yml create mode 100644 requirements.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 732e382..740fbfa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,13 +2,20 @@ sha: cf550fcab3f12015f8676b8278b30e1a5bc10e70 hooks: - id: check-added-large-files - - id: check-json - - id: check-xml - id: check-yaml - id: check-merge-conflict - - id: flake8 - repo: https://www.shore.co.il/git/shell-pre-commit/ sha: v0.1.0 hooks: - id: shell-lint - files: ansible-syntax-check + files: ansible-syntax-check|ansible-vault-check +- repo: local + hooks: + - id: piprot + name: piprot + description: Check up-to-date Python requirements + language: system + entry: piprot + args: ['--quiet', '--outdated'] + files: requirements.txt + always_run: true diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..bd44fad --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +--- +language: python +python: "2.7" +dist: trusty +sudo: false +group: beta +cache: + - pip + - directories: + - $HOME/.pre-commit + +script: + - pre-commit run --all-files + +notifications: + email: false diff --git a/README.rst b/README.rst index 3c6f2fb..3eccb30 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,9 @@ Ansible pre-commit hooks ######################## +.. image:: https://travis-ci.org/adarnimrod/ansible-pre-commit.svg?branch=master + :target: https://travis-ci.org/adarnimrod/ansible-pre-commit + Ansible `pre-commit <http://pre-commit.com/>`_ hooks. - ansible-syntax-check: The hook runs diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..27e4eda --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +ansible==2.2.0.0 +pre-commit==0.9.3 +piprot==0.9.7 -- GitLab