mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Add pre-commit.
This commit is contained in:
parent
db1c32ff6e
commit
a9c892f713
25
.pre-commit-config.yaml
Normal file
25
.pre-commit-config.yaml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
- repo: git@github.com:pre-commit/pre-commit-hooks.git
|
||||||
|
sha: 6f2b0a27e5b9047c6c067fb3d575ba323d572793
|
||||||
|
hooks:
|
||||||
|
- id: autopep8-wrapper
|
||||||
|
args:
|
||||||
|
- --in-place
|
||||||
|
- --aggressive
|
||||||
|
- --aggressive
|
||||||
|
- id: check-added-large-files
|
||||||
|
- id: check-ast
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: check-docstring-first
|
||||||
|
- id: debug-statements
|
||||||
|
- id: double-quote-string-fixer
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: fix-encoding-pragma
|
||||||
|
- id: flake8
|
||||||
|
args: [--ignore=E731]
|
||||||
|
- id: requirements-txt-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- repo: git@github.com:asottile/reorder_python_imports.git
|
||||||
|
sha: 017e2f64306853ec7f000db52b8280da27eb3b96
|
||||||
|
hooks:
|
||||||
|
- id: reorder-python-imports
|
||||||
|
language_version: python2.7
|
13
Makefile
13
Makefile
@ -14,7 +14,10 @@ docs:
|
|||||||
pandoc -s -w markdown docs/header.md docs/install.md docs/body.md -o README.md
|
pandoc -s -w markdown docs/header.md docs/install.md docs/body.md -o README.md
|
||||||
|
|
||||||
flake8:
|
flake8:
|
||||||
@flake8 ./ --config=tox.ini
|
@tox -e flake8
|
||||||
|
|
||||||
|
pre-commit:
|
||||||
|
@tox -e pre-commit -- install -f --install-hooks
|
||||||
|
|
||||||
release: docs
|
release: docs
|
||||||
# Check for tag existence
|
# Check for tag existence
|
||||||
@ -38,11 +41,11 @@ tar:
|
|||||||
git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz
|
git archive --format=tar --prefix autojump_v$(VERSION)/ $(TAGNAME) | gzip > autojump_v$(VERSION).tar.gz
|
||||||
sha1sum autojump_v$(VERSION).tar.gz
|
sha1sum autojump_v$(VERSION).tar.gz
|
||||||
|
|
||||||
test: lint
|
test: pre-commit lint
|
||||||
@find . -type f -iname "*.pyc" -delete
|
@find . -type f -iname '*.py[co]' -delete
|
||||||
tox
|
tox
|
||||||
tox -e flake8
|
tox -e flake8
|
||||||
|
|
||||||
test-fast:
|
test-fast: pre-commit
|
||||||
@find . -type f -iname "*.pyc" -delete
|
@find . -type f -iname '*.py[co]' -delete
|
||||||
tox -e py27
|
tox -e py27
|
||||||
|
8
tox.ini
8
tox.ini
@ -8,7 +8,7 @@ envlist =
|
|||||||
# ignore missing setup.py
|
# ignore missing setup.py
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv:py]
|
||||||
setenv =
|
setenv =
|
||||||
PYTHONDONTWRITEBYTECODE = 1
|
PYTHONDONTWRITEBYTECODE = 1
|
||||||
deps =
|
deps =
|
||||||
@ -30,6 +30,12 @@ deps =
|
|||||||
commands =
|
commands =
|
||||||
flake8 .
|
flake8 .
|
||||||
|
|
||||||
|
[testenv:pre-commit]
|
||||||
|
deps =
|
||||||
|
pre-commit
|
||||||
|
command =
|
||||||
|
pre-commit {posargs}
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
filename =
|
filename =
|
||||||
*.py,
|
*.py,
|
||||||
|
Loading…
Reference in New Issue
Block a user