Add pre-commit to run vint
This commit is contained in:
parent
16d6dd2ce5
commit
2b6b13fcda
|
@ -12,3 +12,4 @@ vim/tmp/
|
||||||
vim/tmp/viminfo.*
|
vim/tmp/viminfo.*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
vim/view/
|
vim/view/
|
||||||
|
.pre_commit_env/
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v1.2.3
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
# After merging, this should change to the upstream and point to master
|
||||||
|
- repo: https://github.com/ViViDboarder/vint
|
||||||
|
rev: pre-commit-support
|
||||||
|
hooks:
|
||||||
|
- id: vint
|
19
Makefile
19
Makefile
|
@ -1,3 +1,6 @@
|
||||||
|
PRE_COMMIT_ENV ?= .pre_commit_env
|
||||||
|
PRE_COMMIT_ENV_BIN ?= $(PRE_COMMIT_ENV)/bin
|
||||||
|
|
||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: install
|
default: install
|
||||||
|
|
||||||
|
@ -21,3 +24,19 @@ uninstall:
|
||||||
clean:
|
clean:
|
||||||
rm -fr ./vim/plugged
|
rm -fr ./vim/plugged
|
||||||
rm -fr ./vim/autoload/plug.vim
|
rm -fr ./vim/autoload/plug.vim
|
||||||
|
|
||||||
|
# Installs pre-commit hooks
|
||||||
|
$(PRE_COMMIT_ENV):
|
||||||
|
virtualenv $(PRE_COMMIT_ENV)
|
||||||
|
|
||||||
|
$(PRE_COMMIT_ENV_BIN)/pre-commit: $(PRE_COMMIT_ENV)
|
||||||
|
$(PRE_COMMIT_ENV_BIN)/pip install pre-commit
|
||||||
|
|
||||||
|
.PHONY: install-hooks
|
||||||
|
install-hooks: $(PRE_COMMIT_ENV_BIN)/pre-commit
|
||||||
|
$(PRE_COMMIT_ENV_BIN)/pre-commit install-hooks
|
||||||
|
|
||||||
|
# Checks files for encryption
|
||||||
|
.PHONY: check
|
||||||
|
check: $(PRE_COMMIT_ENV_BIN)/pre-commit
|
||||||
|
$(PRE_COMMIT_ENV_BIN)/pre-commit run --all-files
|
||||||
|
|
Loading…
Reference in New Issue