Move flake8 as a pre-commit local target.
The goal here is to avoid conflicts between flake8 and hacking version
each 2 days.
Inspired from nova's approach [1].
The flake8 version to install will be determined by hacking and
requirements [2] will stay aligned instead of relying on different
versions.
[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1
Change-Id: I29daa7205fc28e2768792c24fa054257e9f66674
(cherry picked from commit 1f5c95272e48633a3fce4db573258d015c14f238)
Daniel Bengtsson authored 3 years ago
Stephen Finucane committed 3 years ago
8 | 8 | |
9 | 9 | repos: |
10 | 10 | - repo: https://github.com/pre-commit/pre-commit-hooks |
11 | rev: ebc15addedad713c86ef18ae9632c88e187dd0af # v3.1.0 | |
11 | rev: 9136088a246768144165fcc3ecc3d31bb686920a # v3.3.0 | |
12 | 12 | hooks: |
13 | 13 | - id: trailing-whitespace |
14 | 14 | # Replaces or checks mixed line ending |
26 | 26 | - id: debug-statements |
27 | 27 | - id: check-yaml |
28 | 28 | files: .*\.(yaml|yml)$ |
29 | - repo: https://gitlab.com/pycqa/flake8 | |
30 | rev: 181bb46098dddf7e2d45319ea654b4b4d58c2840 # 3.8.3 | |
29 | - repo: local | |
31 | 30 | hooks: |
32 | 31 | - id: flake8 |
32 | name: flake8 | |
33 | 33 | additional_dependencies: |
34 | 34 | - hacking>=3.0.1,<3.1.0 |
35 | language: python | |
36 | entry: flake8 | |
37 | files: '^.*\.py$' | |
38 | exclude: '^(doc|releasenotes|tools)/.*$' |