Update pre-commit-hooks repo version (#9195)

- use official isort pre-commit-hook
- use official yamllint pre-commit-hook
- run isort pre-commit-hook on all python files instead of files ending with py
This commit is contained in:
Felix Uellendall 2020-06-14 02:37:30 +02:00 коммит произвёл GitHub
Родитель 34d0c2d981
Коммит 1698db4ac1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 19 добавлений и 18 удалений

Просмотреть файл

@ -141,7 +141,7 @@ metastore_browser/templates/.*\\.html$|.*\\.jinja2"
hooks:
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
rev: v3.1.0
hooks:
- id: check-merge-conflict
- id: debug-statements
@ -159,15 +159,24 @@ metastore_browser/templates/.*\\.html$|.*\\.jinja2"
hooks:
- id: rst-backticks
- id: python-no-log-warn
- repo: local
- repo: https://github.com/adrienverge/yamllint
rev: v1.23.0
hooks:
- id: yamllint
name: Check yaml files with yamllint
entry: yamllint -c yamllint-config.yml
language: python
additional_dependencies: ['yamllint']
types: [yaml]
exclude: ^.*init_git_sync\.template\.yaml$|^.*airflow\.template\.yaml$
- repo: https://github.com/timothycrosley/isort
rev: 4.3.21-2
hooks:
- id: isort
name: Run isort to sort imports
types: [python]
# To keep consistent with the global isort skip config defined in setup.cfg
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
- repo: local
hooks:
- id: shellcheck
name: Check Shell scripts syntax correctness
language: docker_image
@ -190,14 +199,6 @@ metastore_browser/templates/.*\\.html$|.*\\.jinja2"
entry: "./scripts/ci/pre_commit_lint_dockerfile.sh"
files: ^Dockerfile.*$
pass_filenames: true
- id: isort
name: Run isort to sort imports
language: python
entry: isort
files: \.py$
# To keep consistent with the global isort skip config defined in setup.cfg
exclude: ^build/.*$|^.tox/.*$|^venv/.*$
additional_dependencies: ['isort']
- id: setup-order
name: Checks for an order of dependencies in setup.py
language: python

Просмотреть файл

@ -20,11 +20,11 @@
# This tool is based on the Spark merge_spark_pr script:
# https://github.com/apache/spark/blob/master/dev/merge_spark_pr.py
from collections import defaultdict, Counter
import jira
import re
import sys
from collections import Counter, defaultdict
import jira
PROJECT = "AIRFLOW"

Просмотреть файл

@ -21,12 +21,12 @@ import re
import shlex
import shutil
import sys
from functools import total_ordering
from subprocess import run
from contextlib import suppress
from functools import total_ordering
from glob import glob
from subprocess import run
from tempfile import NamedTemporaryFile
from typing import NamedTuple, List, Iterable, Set, Optional
from typing import Iterable, List, NamedTuple, Optional, Set
if __name__ != "__main__":
raise Exception(