Merge pull request #52 from wting/wting_add_precommit
Add and run pre-commit, automatically replacing tabs with spaces on commit.
Esse commit está contido em:
@@ -1 +1,2 @@
|
||||
tab*
|
||||
.tox
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"esversion": 6
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
- repo: git://github.com/pre-commit/pre-commit-hooks.git
|
||||
sha: 6b1aa19425b35f8c34f43ada8f1045b028dc19a5
|
||||
hooks:
|
||||
- id: autopep8-wrapper
|
||||
args:
|
||||
- --in-place
|
||||
- --aggressive
|
||||
- --aggressive
|
||||
- --max-line-length=131
|
||||
- id: check-ast
|
||||
- id: check-case-conflict
|
||||
- id: check-docstring-first
|
||||
- id: check-json
|
||||
files: \.(jshintrc|json)$
|
||||
- id: debug-statements
|
||||
- id: double-quote-string-fixer
|
||||
- id: end-of-file-fixer
|
||||
- id: fix-encoding-pragma
|
||||
- id: flake8
|
||||
args:
|
||||
- --max-line-length=131
|
||||
- --ignore=E126,E128,E731
|
||||
- id: pretty-format-json
|
||||
args:
|
||||
- --autofix
|
||||
- --indent
|
||||
- '4'
|
||||
- id: requirements-txt-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: git://github.com/pre-commit/mirrors-jshint
|
||||
sha: 431358a85a3084cb86d731f2cd46490ec04f5c69
|
||||
hooks:
|
||||
- id: jshint
|
||||
args:
|
||||
- --config=.jshintrc
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
.PHONY: pre-commit clean test
|
||||
|
||||
pre-commit:
|
||||
@tox -e pre-commit -- install -f --install-hooks
|
||||
|
||||
test: pre-commit
|
||||
@tox -e pre-commit -- run --all-files
|
||||
@tox
|
||||
|
||||
clean:
|
||||
@rm -fr .tox
|
||||
@find . -name '*.py[co]' -delete
|
||||
@find . -name '__pycache__' -delete
|
||||
@@ -10,4 +10,3 @@
|
||||
|
||||
<img src="http://img.pandawhale.com/168221-Silicon-Valley-Russ-Hanneman-t-Earx.gif"></img>
|
||||
# THIS. GUY. FUCKS.
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
let spaces = true;
|
||||
while (spaces) {
|
||||
console.log('SPACES FOREVER! <3');
|
||||
}
|
||||
}());
|
||||
|
||||
+6
-2
@@ -1,4 +1,8 @@
|
||||
from myModule import someTabs
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from myModule import someTabs # noqa
|
||||
|
||||
for x in range(100):
|
||||
print "BWAHAHAHAHAHAHA"
|
||||
print 'BWAHAHAHAHAHAHA'
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[tox]
|
||||
envlist = py27,py35
|
||||
skipsdist = true
|
||||
|
||||
[testenv:pre-commit]
|
||||
deps =
|
||||
pre-commit
|
||||
commands =
|
||||
pre-commit {posargs}
|
||||
Referência em uma Nova Issue
Bloquear um usuário