aboutsummaryrefslogtreecommitdiff
path: root/.pre-commit-config.yaml
blob: b601b03c7650aa0ae796d2b4c31ef062afb3e1d1 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# SPDX-FileCopyrightText: Copyright 2022-2024, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
# Pre-commit checks
#
# General policy:

# - tools that *fix* issues are preferred to tools that only *gripe*
#   about issues, both can coexist, but when the conflict we
#   selectivly reconfigure the griper not the fixer.
#

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
  rev: v4.4.0
  hooks:
    - id: check-yaml

    - id: check-toml

    - id: end-of-file-fixer

    - id: trailing-whitespace

    - id: mixed-line-ending
      args: ['--fix=lf']
      description: Forces to replace line ending by the UNIX 'lf' character.

    - id: detect-private-key

    - id: check-executables-have-shebangs

    - id: check-added-large-files
      args: ['--maxkb=300', "--enforce-all"]
      exclude: src/mlia/resources

- repo: https://github.com/Lucas-C/pre-commit-hooks
  rev: v1.3.1
  hooks:
    - id: remove-tabs
      args: [--whitespaces-count, '8']

- repo: https://github.com/asottile/reorder_python_imports
  rev: v3.10.0
  hooks:
    - id: reorder-python-imports
      args: ["--application-directories", ".:src"]

- repo: https://github.com/asottile/pyupgrade
  rev: v3.10.1
  hooks:
    - id: pyupgrade
      args: ["--py38-plus"]

- repo: https://github.com/psf/black
  rev: 23.7.0
  hooks:
    - id: black

- repo: https://github.com/PyCQA/flake8
  rev: 6.1.0
  hooks:
    - id: flake8

- repo: https://github.com/PyCQA/pydocstyle
  rev: 6.3.0
  hooks:
    - id: pydocstyle

- repo: https://github.com/markdownlint/markdownlint
  rev: v0.12.0
  hooks:
    - id: markdownlint
      args: ["-r", "~MD024,~MD002,~MD013"]

- repo: https://github.com/ryanrhee/shellcheck-py
  rev: v0.9.0.5
  hooks:
    - id: shellcheck
      args: [-f, gcc, -x]

- repo: https://github.com/fsfe/reuse-tool
  rev: v2.1.0
  hooks:
    - id: reuse

- repo: https://github.com/PrincetonUniversity/blocklint
  rev: v0.2.4
  hooks:
    - id: blocklint
      exclude: setup.cfg

- repo: https://github.com/PyCQA/bandit
  rev: 1.7.5
  hooks:
    - id: bandit
      args: ["--skip", "B101"]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
  rev: v2.11.0
  hooks:
  - id: pretty-format-toml
    args: [--autofix, "--no-sort", --indent, "4"]

- repo: local
  hooks:
    - id: mypy
      name: mypy
      entry: mypy
      language: python
      types: [python]
      require_serial: true
      additional_dependencies: []

- repo: local
  hooks:
    - id: pylint
      name: pylint
      entry: pylint
      language: system
      types: [python]

- repo: https://github.com/commitizen-tools/commitizen
  rev: v3.13.0
  hooks:
    - id: commitizen-branch
      args: [--rev-range, HEAD~1..HEAD]