2019-08-15 03:53:28 +03:00
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
---
|
|
|
|
default_stages: [commit, push]
|
2019-08-22 17:13:56 +03:00
|
|
|
default_language_version:
|
|
|
|
# force all unspecified python hooks to run python3
|
|
|
|
python: python3
|
2019-08-15 03:53:28 +03:00
|
|
|
repos:
|
2019-08-23 23:19:27 +03:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: build
|
|
|
|
name: Check if image build is needed
|
|
|
|
entry: ./scripts/ci/ci_build.sh
|
|
|
|
language: system
|
|
|
|
always_run: true
|
|
|
|
pass_filenames: false
|
|
|
|
- id: check-apache-license
|
|
|
|
name: Check if licences are OK for Apache
|
|
|
|
entry: ./scripts/ci/ci_check_license.sh
|
|
|
|
language: system
|
2019-09-02 03:13:39 +03:00
|
|
|
files: ^.*LICENSE.*$|^.*LICENCE.*$
|
|
|
|
pass_filenames: false
|
|
|
|
require_serial: true
|
2019-09-04 16:56:03 +03:00
|
|
|
- repo: https://github.com/Lucas-C/pre-commit-hooks
|
|
|
|
rev: v1.1.7
|
2019-08-16 02:59:35 +03:00
|
|
|
hooks:
|
2019-08-16 17:35:34 +03:00
|
|
|
- id: forbid-tabs
|
|
|
|
exclude: ^airflow/_vendor/.*$|^docs/Makefile$
|
2019-08-16 02:59:35 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all SQL files
|
|
|
|
files: \.sql$
|
|
|
|
exclude: ^\.github/.*$|^airflow/_vendor/.*$
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "/*||*/"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-16 03:02:53 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all other files
|
|
|
|
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "|#|"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-16 03:02:53 +03:00
|
|
|
files: >
|
|
|
|
\.properties$|\.cfg$|\.conf$|\.ini$|\.ldif$|\.readthedocs$|\.service$|^Dockerfile.*$
|
2019-08-16 07:09:26 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all rst files
|
|
|
|
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "||"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.rst
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-16 07:09:26 +03:00
|
|
|
files: \.rst$
|
2019-08-16 03:06:18 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all JS files
|
|
|
|
files: \.js$
|
|
|
|
exclude: ^\.github/.*$|^airflow/_vendor/.*$
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "/**| *| */"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all JINJA template files
|
|
|
|
files: ^airflow/www/templates/.*\.html$|^docs/templates/.*\.html$|^airflow/contrib/plugins/metastore_browser/templates/.*\.html$ # yamllint disable-line rule:line-length
|
|
|
|
exclude: ^\.github/.*$|^airflow/_vendor/.*$
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "{#||#}"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-20 07:07:39 +03:00
|
|
|
- id: insert-license
|
2019-09-17 14:16:32 +03:00
|
|
|
name: Add licence for all shell files
|
2019-08-20 07:07:39 +03:00
|
|
|
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
|
|
|
|
types: [shell]
|
2019-09-10 11:16:10 +03:00
|
|
|
files: ^breeze$|^breeze-complete$|\.sh$
|
2019-08-20 07:07:39 +03:00
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "|#|"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-09-17 14:16:32 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all python files
|
|
|
|
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
|
|
|
|
types: [python]
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "|#|"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-20 17:29:34 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all XML files
|
|
|
|
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
|
|
|
|
types: [xml]
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "<!--||-->"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-22 17:13:56 +03:00
|
|
|
- id: insert-license
|
2019-09-17 14:16:32 +03:00
|
|
|
name: Add licence for all yaml files
|
2019-08-22 17:13:56 +03:00
|
|
|
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
|
|
|
|
types: [yaml]
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "|#|"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-22 06:27:54 +03:00
|
|
|
- id: insert-license
|
|
|
|
name: Add licence for all md files
|
|
|
|
files: \.md$
|
|
|
|
exclude: ^\.github/.*$|^airflow/_vendor/.*$
|
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "<!--|| -->"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
2019-08-22 06:27:54 +03:00
|
|
|
- repo: https://github.com/thlorenz/doctoc.git
|
|
|
|
rev: v1.4.0
|
|
|
|
hooks:
|
|
|
|
- id: doctoc
|
|
|
|
name: Add TOC for md files
|
|
|
|
files: ^README\.md$|^CONTRIBUTING\.md$|^UPDATING.md$|^dev/README.md$
|
|
|
|
args:
|
|
|
|
- "--maxlevel"
|
|
|
|
- "2"
|
2019-08-16 17:35:34 +03:00
|
|
|
- repo: meta
|
|
|
|
hooks:
|
|
|
|
- id: check-hooks-apply
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
|
|
rev: v2.3.0
|
|
|
|
hooks:
|
|
|
|
- id: check-merge-conflict
|
|
|
|
- id: detect-private-key
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
- id: mixed-line-ending
|
2019-08-20 17:29:34 +03:00
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-xml
|
2019-08-15 03:53:28 +03:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
2019-08-22 17:13:56 +03:00
|
|
|
- id: yamllint
|
|
|
|
name: Check yaml files with yamllint
|
|
|
|
entry: yamllint -c yamllint-config.yml
|
|
|
|
language: python
|
2019-09-01 12:13:50 +03:00
|
|
|
additional_dependencies: ['yamllint']
|
2019-08-22 17:13:56 +03:00
|
|
|
types: [yaml]
|
|
|
|
exclude: ^.*init_git_sync\.template\.yaml$|^.*airflow\.template\.yaml$
|
2019-08-20 07:07:39 +03:00
|
|
|
- id: shellcheck
|
|
|
|
name: Check Shell scripts syntax correctness
|
|
|
|
language: docker_image
|
|
|
|
entry: koalaman/shellcheck:stable -x -a
|
|
|
|
types: [shell]
|
2019-09-10 11:16:10 +03:00
|
|
|
files: ^breeze$|^breeze-complete$|\.sh$
|
|
|
|
exclude: ^airflow/_vendor/.*$
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: lint-dockerfile
|
|
|
|
name: Lint dockerfile
|
|
|
|
language: system
|
|
|
|
entry: ./scripts/ci/ci_lint_dockerfile.sh
|
|
|
|
files: ^Dockerfile.*$
|
|
|
|
- id: mypy
|
|
|
|
name: Run mypy
|
|
|
|
language: system
|
|
|
|
entry: ./scripts/ci/ci_mypy.sh
|
|
|
|
files: \.py$
|
2019-08-23 23:19:27 +03:00
|
|
|
exclude: ^airflow/_vendor/.*$
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: pylint
|
|
|
|
name: Run pylint for main sources
|
|
|
|
language: system
|
|
|
|
entry: ./scripts/ci/ci_pylint_main.sh
|
|
|
|
files: \.py$
|
2019-08-23 23:19:27 +03:00
|
|
|
exclude: ^tests/.*\.py$|^airflow/_vendor/.*$
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: pylint
|
|
|
|
name: Run pylint for tests
|
|
|
|
language: system
|
|
|
|
entry: ./scripts/ci/ci_pylint_tests.sh
|
|
|
|
files: ^tests/.*\.py$
|
|
|
|
- id: flake8
|
|
|
|
name: Run flake8
|
|
|
|
language: system
|
|
|
|
entry: ./scripts/ci/ci_flake8.sh
|
|
|
|
files: \.py$
|