Skip to content

Local checking: pre commit

lachmanfrantisek edited this page Feb 20, 2019 · 7 revisions

pre-commit

$ pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
Trim Trailing Whitespace.................................................Failed
hookid: trailing-whitespace

Files were modified by this hook. Additional output:

Fixing release-conf.yaml
Fixing CONTRIBUTING.md

$ pre-commit run --all-files
Trim Trailing Whitespace.................................................Passed
  • example config:
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.1.0
    hooks:
    - id: trailing-whitespace
    - id: detect-private-key
-   repo: https://github.com/ambv/black
    rev: stable
    hooks:
    - id: black
      language_version: python3.6
Clone this wiki locally