forked from aristanetworks/avd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
88 lines (79 loc) · 2.92 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
88
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
exclude: ansible_collections/arista/avd/molecule
- id: end-of-file-fixer
exclude_types: [svg, json]
exclude: ansible_collections/arista/avd/molecule
- id: check-added-large-files
exclude: ansible_collections/arista/avd/molecule
- id: check-merge-conflict
exclude: ansible_collections/arista/avd/molecule
# - repo: https://github.com/pre-commit/mirrors-autopep8
# rev: 'v1.5.6' # Use the sha / tag you want to point at
# hooks:
# - id: autopep8
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: Check for changes when running isort on all python files
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
name: Check for changes when running Black on all python files
- repo: https://github.com/pycqa/flake8
rev: 4.0.1 # Note ansible-test uses pycodestyle 2.8.0 which is part of this tagged release of flake8
hooks:
- id: flake8
name: Check for Flake8 errors on Python files
# ignoring errors and selecting line length as per
# https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/_util/controller/sanity/pep8/current-ignore.txt
types: [python]
- repo: https://github.com/pycqa/pylint
rev: "v2.16.1"
hooks:
- id: pylint # Use pylintrc file in repository
name: Check for Linting errors on Python files
description: This hook runs pylint.
types: [python]
args:
# Suppress duplicate code for modules header
- -d duplicate-code
- repo: https://github.com/adrienverge/yamllint.git
rev: "v1.23.0"
hooks:
- id: yamllint
name: Check for Linting errors on YAML files
description: This hook runs yamllint.
entry: yamllint
language: python
types: [file, yaml]
args: [--strict, -c=.github/yamllintrc]
- repo: https://github.com/aristanetworks/j2lint.git
rev: "f045784"
hooks:
- id: j2lint
name: Check for Linting errors on Jinja2 files
- repo: local
hooks:
- id: schemas
name: Build AVD Schemas and Documentation
entry: sh -c 'exec env ANSIBLE_COLLECTIONS_PATHS=`pwd` ansible-playbook --forks 10 arista.avd._build_schemas_and_docs'
language: system
files: ansible_collections/arista/avd/roles/[a-z_]+/schemas
pass_filenames: false
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.1
hooks:
- id: markdownlint
name: Check for Linting errors on MarkDown files
args:
- --config=.github/.markdownlint.yaml
- --ignore-path=.github/.markdownlintignore
- --fix