forked from rlworkgroup/garage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
87 lines (81 loc) · 4.19 KB
/
.pre-commit-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
fail_fast: false # set to true to have pre-commit stop running hooks after the first failure.
default_stages: [commit, push]
repos:
- repo: local
hooks:
- id: check-commit-message
stages: [commit-msg]
name: Check commit message
language: script
entry: scripts/check_commit_message
- id: check-pylint-normal
name: Check pylint (except unit tests and benchmarks)
types: [file, python]
exclude: (^tests/garage/.*$|^benchmarks/) # exclude unit tests and benchmarks
require_serial: true # pylint does its own parallelism
language: system
entry: pylint
- id: check-pylint-unit-tests
name: Check pylint for unit tests and benchmarks
types: [file, python]
files: (^tests/garage/.*$|^benchmarks/) # check only unit tests and benchmarks
require_serial: true # pylint does its own parallelism
language: system
entry: pylint
args: [--rcfile=tests/garage/.pylintrc]
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
hooks:
- id: isort
name: Sort imports with isort
entry: isort
language: python
types: [python]
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
hooks:
- id: yapf
name: Format code with yapf
args: ['-ipr']
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: check-added-large-files # Prevent giant files from being committed.
- id: check-ast # Simply check whether files parse as valid python.
- id: check-byte-order-marker # Forbid files which have a UTF-8 byte-order marker
- id: check-docstring-first # Checks for a common error of placing code before the docstring.
- id: check-executables-have-shebangs # Checks that non-binary executables have a proper shebang.
- id: check-json # Attempts to load all json files to verify syntax.
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-symlinks # Checks for symlinks which do not point to anything.
- id: check-toml # Attempts to load all toml files to verify syntax.
- id: check-vcs-permalinks # Ensures that links to vcs websites are permalinks.
- id: check-xml # Attempts to load all xml files to verify syntax.
- id: check-yaml # Attempts to load all yaml files to verify syntax.
- id: debug-statements # Check for debugger imports and py37+ breakpoint() calls in python source.
- id: detect-private-key # Checks for the existence of private keys.
- id: double-quote-string-fixer # This hook replaces double quoted strings with single quoted strings.
- id: end-of-file-fixer # Makes sure files end in a newline and only a newline.
exclude: docs/bibtex.json # auto-generated file, but version controlled for use in readthedocs
- id: forbid-new-submodules # Prevent addition of new git submodules.
- id: mixed-line-ending # Replaces or checks mixed line ending.
- id: pretty-format-json # Checks that all your JSON files have keys that are sorted and indented.
exclude: docs/bibtex.json # auto-generated file, but version controlled for use in readthedocs
- id: trailing-whitespace # Trims trailing whitespace.
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: flake8 # Run flake8 on your Python files
additional_dependencies:
- 'flake8-docstrings>=1.5.0'
- 'pycodestyle>=2.5.0'
- 'pydocstyle>=4.0.0'
- repo: https://github.com/markdownlint/markdownlint
rev: v0.9.0
hooks:
- id: markdownlint # Check markdown files and flag style issues
name: Markdownlint
description: Run markdownlint on your Markdown files
entry: mdl
language: ruby
files: \.(md|mdown|markdown)$