Merge branch 'feature/pre-commit-hook' into enforce-pre-commit

* feature/pre-commit-hook:
  Don't touch tab indentations, they are there for a good reason
  another round of refinements after PR #1434
  Add a note on how to use the pre-commit yaml.
  Enforce some coding standards for the contributers
pull/1434/head
Ira Abramov 2020-03-10 10:13:29 +02:00
commit f6ae1cd81a
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# 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
- id: shfmt
- repo: git://github.com/detailyang/pre-commit-shell
rev: 1.0.5
hooks:
- id: shell-lint
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
hooks:
# - id: forbid-crlf
- id: remove-crlf

View File

@ -43,3 +43,11 @@ For `aliases`, `plugins` and `completions`, the following rules are applied that
Having the order based on a numeric priority in a common directory allows for more flexibility. While in general, aliases are loaded first (since their default priority is 150), it's possible to load some aliases after the plugins, or some plugins after completions by setting the items' load priority. This is more flexible than a fixed type-based order or a strict alphabetical order based on name.
These items are subject to change. When making changes to the internal functionality, this page needs to be updated as well.
## 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).