Make hooks specify files. Optionally allow config to override manifest.

This commit is contained in:
Anthony Sottile 2014-06-05 18:37:33 -07:00
parent 0ec9020346
commit 96174deac6
25 changed files with 81 additions and 50 deletions

View file

@ -2,19 +2,12 @@
sha: bec87f6c87284ea15dbcf7801810404c8036bab4
hooks:
- id: pyflakes
files: \.py$
- id: debug-statements
files: \.py$
- id: trailing-whitespace
files: \.(py|sh|yaml)$
- id: name-tests-test
files: tests/.+\.py$
- id: end-of-file-fixer
files: \.(py|sh|yaml)$
- repo: git@github.com:pre-commit/pre-commit
sha: c62c1a3b513ab9e057e85a5e950bd7c438371076
hooks:
- id: validate_manifest
files: ^hooks.yaml$
- id: validate_config
files: ^\.pre-commit-config.yaml$

View file

@ -2,3 +2,4 @@
name: Failing hook
entry: bin/hook.sh
language: script
files: .

View file

@ -2,3 +2,4 @@
name: Bar
entry: bar
language: python
files: \.py$

View file

@ -3,3 +3,4 @@
entry: node-11-8-hook
language: node
language_version: 0.11.8
files: \.js$

View file

@ -2,3 +2,4 @@
name: Foo
entry: foo
language: node
files: \.js$

View file

@ -2,3 +2,4 @@
name: Prints Cwd
entry: pwd
language: system
files: \.sh$

View file

@ -3,3 +3,4 @@
entry: python3-hook
language: python
language_version: python3.3
files: \.py$

View file

@ -2,3 +2,4 @@
name: Foo
entry: foo
language: python
files: \.py$

View file

@ -3,3 +3,4 @@
entry: ruby_hook
language: ruby
language_version: 1.9.3-p547
files: \.rb$

View file

@ -2,3 +2,4 @@
name: Ruby Hook
entry: ruby_hook
language: ruby
files: \.rb$

View file

@ -2,3 +2,4 @@
name: Bash hook
entry: bin/hook.sh
language: script
files: ''

View file

@ -2,3 +2,4 @@
name: System hook with spaces
entry: /usr/bin/python -c 'import sys; print("Hello World")'
language: system
files: \.sh$

View file

@ -3,4 +3,3 @@
- id: pyflakes
- id: jslint
- id: trim_trailing_whitespace
files: '*.py'