Skip to content

Commit

Permalink
Update pre-commit-hooks repo version (apache#9195)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
feluelle authored Jun 14, 2020
1 parent 34d0c2d commit 1698db4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
25 changes: 13 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dev/airflow-jira
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 3 additions & 3 deletions docs/build
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 1698db4

Please sign in to comment.