mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-05 02:26:44 +00:00
Add pre-commit to run vint
This commit is contained in:
parent
42d33b9f48
commit
f2a766d1e6
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ vim/tmp/*
|
||||
vim/tmp/viminfo.*
|
||||
.DS_Store
|
||||
vim/view/
|
||||
.pre_commit_env/
|
||||
|
12
.pre-commit-config.yaml
Normal file
12
.pre-commit-config.yaml
Normal file
@ -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
|
||||
default: install
|
||||
|
||||
@ -21,3 +24,19 @@ uninstall:
|
||||
clean:
|
||||
rm -fr ./vim/plugged
|
||||
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
Block a user