.pre-commit-config.yaml 1.42 KB
Newer Older
1
2
3
4
5
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.

6
# If you change the versions below, please make sure they are in-sync
7
# with requirements-dev.txt
8

Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
9
10
11
12
13
14
15
exclude: 'build|stubs'

default_language_version:
    python: python3

repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
16
    rev: v4.0.1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
17
18
19
20
21
22
23
24
25
    hooks:
    -   id: trailing-whitespace
    -   id: check-ast
    -   id: check-merge-conflict
    -   id: check-added-large-files
        args: ['--maxkb=500']
    -   id: end-of-file-fixer

-   repo: https://github.com/ambv/black
26
    rev: 21.10b0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
27
28
29
30
    hooks:
    - id: black

-   repo: https://gitlab.com/pycqa/flake8
31
    rev: 4.0.1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
32
33
    hooks:
    -   id: flake8
34
        args: [--show-source, --statistics]
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
35
36

-   repo: https://github.com/asottile/seed-isort-config
37
    rev: v2.2.0
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
38
39
40
    hooks:
    -   id: seed-isort-config

41
-   repo: https://github.com/pycqa/isort
42
    rev: 5.10.1
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
43
44
    hooks:
    -   id: isort
Tom Birch's avatar
Tom Birch committed
45
        exclude: README.md
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
46
47
48
        additional_dependencies: [toml]

-   repo: https://github.com/pre-commit/mirrors-mypy
49
    rev: 'v0.910'
Mandeep Singh Baines's avatar
Mandeep Singh Baines committed
50
51
    hooks:
    -   id: mypy
52
        args: [--no-strict-optional, --ignore-missing-imports, --scripts-are-modules, --pretty]
53
54
        # See requirements-dev.txt for the reason for a fixed version of numpy here.
        additional_dependencies: [numpy==1.21.5]