commit
3f318914fd
|
|
@ -0,0 +1,27 @@
|
||||||
|
# See https://pre-commit.com for more information
|
||||||
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
|
---
|
||||||
|
# fail_fast: true
|
||||||
|
minimum_pre_commit_version: 1.18.1
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.3.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: mixed-line-ending
|
||||||
|
- id: check-added-large-files
|
||||||
|
- repo: https://github.com/jumanjihouse/pre-commit-hooks
|
||||||
|
rev: 1.11.0
|
||||||
|
hooks:
|
||||||
|
- id: git-check # Configure in .gitattributes
|
||||||
|
- id: shellcheck
|
||||||
|
exclude: ".bats$"
|
||||||
|
- id: shfmt
|
||||||
|
exclude: ".bats$"
|
||||||
|
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
||||||
|
rev: v1.1.7
|
||||||
|
hooks:
|
||||||
|
# - id: forbid-crlf
|
||||||
|
- id: remove-crlf
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
# We use colors and not assigned
|
||||||
|
disable=SC2154
|
||||||
|
# Hard to fix
|
||||||
|
disable=SC2155
|
||||||
|
# shellcheck is wrong on some
|
||||||
|
disable=SC2034
|
||||||
26
.travis.yml
26
.travis.yml
|
|
@ -12,19 +12,39 @@ os: linux
|
||||||
|
|
||||||
dist: xenial
|
dist: xenial
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "${HOME}/.cache/pip"
|
||||||
|
- "${HOME}/.cache/pre-commit"
|
||||||
|
- "${HOME}/.pre-commit-venv"
|
||||||
|
- "${HOME}/bin"
|
||||||
|
- /usr/lib/python3.8
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
include:
|
||||||
|
- language: go
|
||||||
|
go: "1.14"
|
||||||
|
name: Ubuntu 18.04
|
||||||
|
dist: bionic
|
||||||
|
sudo: required
|
||||||
|
before_script:
|
||||||
|
GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt;
|
||||||
|
curl https://pre-commit.com/install-local.py | python3 -
|
||||||
|
script:
|
||||||
|
pre-commit run --files `cat clean_files.txt`;
|
||||||
|
|
||||||
- <<: *native_job
|
- <<: *native_job
|
||||||
name: Ubuntu 16.04
|
name: Ubuntu 16.04
|
||||||
|
|
||||||
- <<: *native_job
|
- <<: *native_job
|
||||||
name: Ubuntu 18.04
|
name: Ubuntu 18.04
|
||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
||||||
- <<: *native_job
|
- <<: *native_job
|
||||||
name: MacOS xcode9.4
|
name: MacOS xcode9.4
|
||||||
os: osx
|
os: osx
|
||||||
osx_image: xcode9.4 # Default xcode on Travis.
|
osx_image: xcode9.4 # Default xcode on Travis.
|
||||||
|
|
||||||
- <<: *native_job
|
- <<: *native_job
|
||||||
name: MacOS xcode11.5
|
name: MacOS xcode11.5
|
||||||
os: osx
|
os: osx
|
||||||
|
|
|
||||||
|
|
@ -64,3 +64,11 @@ These items are subject to change. When making changes to the internal functiona
|
||||||
|
|
||||||
Plugins can define a function that will be called when the plugin is being disabled.
|
Plugins can define a function that will be called when the plugin is being disabled.
|
||||||
The callback name should be `{PLUGIN_NAME}_on_disable`, you can see `gitstatus` for usage example.
|
The callback name should be `{PLUGIN_NAME}_on_disable`, you can see `gitstatus` for usage example.
|
||||||
|
|
||||||
|
## Using the pre-commit hook
|
||||||
|
|
||||||
|
Note the file .pre-commit-config.yaml at the top of the repo.
|
||||||
|
This file configures the behavior of the a pre-commit hook based on [the Pre-Commit framework](https://pre-commit.com/). Please see the site about
|
||||||
|
installing it (with pip, brew or other tools) then run `pre-commit install` in the repo's root to activate the hook.
|
||||||
|
For the full use of the tool, you may need to install also other third-party tools, such as
|
||||||
|
[shellcheck](https://github.com/koalaman/shellcheck/) and [shfmt](https://github.com/mvdan/sh).
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
pre-commit==2.3.0
|
||||||
Loading…
Reference in New Issue