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-11-04 11:50:06 +03:00
|
|
|
minimum_pre_commit_version: "1.20.0"
|
2019-08-15 03:53:28 +03:00
|
|
|
repos:
|
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
|
2020-07-07 20:48:28 +03:00
|
|
|
exclude: ^docs/Makefile$|^clients/gen/go.sh
|
2019-08-16 02:59:35 +03:00
|
|
|
- id: insert-license
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all SQL files
|
2019-08-16 02:59:35 +03:00
|
|
|
files: \.sql$
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-16 02:59:35 +03:00
|
|
|
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
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all other files
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-16 03:02:53 +03:00
|
|
|
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: >
|
2020-06-10 18:20:08 +03:00
|
|
|
\.properties$|\.cfg$|\.conf$|\.ini$|\.ldif$|\.readthedocs$|\.service$|\.tf$|^Dockerfile.*$
|
2019-08-16 07:09:26 +03:00
|
|
|
- id: insert-license
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all rst files
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-16 07:09:26 +03:00
|
|
|
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
|
2019-11-26 00:11:26 +03:00
|
|
|
name: Add license for all JS/CSS files
|
|
|
|
files: \.(js|css)$
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-16 03:06:18 +03:00
|
|
|
args:
|
|
|
|
- --comment-style
|
|
|
|
- "/**| *| */"
|
|
|
|
- --license-filepath
|
|
|
|
- license-templates/LICENSE.txt
|
2019-08-27 21:06:41 +03:00
|
|
|
- --fuzzy-match-generates-todo
|
|
|
|
- id: insert-license
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all JINJA template files
|
2020-06-29 09:08:58 +03:00
|
|
|
files: "^airflow/www/templates/.*\\.html$|^docs/templates/.*\\.html$.*\\.jinja2"
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-27 21:06:41 +03:00
|
|
|
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-10-26 14:31:51 +03:00
|
|
|
name: Add license for all shell files
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2020-01-07 17:38:05 +03:00
|
|
|
files: ^breeze$|^breeze-complete$|\.sh$|\.bash$|\.bats$
|
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
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all python files
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-09-17 14:16:32 +03:00
|
|
|
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
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all XML files
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-20 17:29:34 +03:00
|
|
|
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-10-26 14:31:51 +03:00
|
|
|
name: Add license for all yaml files
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$
|
2019-08-22 17:13:56 +03:00
|
|
|
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
|
2019-10-26 14:31:51 +03:00
|
|
|
name: Add license for all md files
|
2019-08-22 06:27:54 +03:00
|
|
|
files: \.md$
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^\.github/.*$|PROVIDERS_CHANGES.*\.md
|
2019-08-22 06:27:54 +03:00
|
|
|
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
|
2020-05-15 20:00:15 +03:00
|
|
|
files: ^README\.md$|^CONTRIBUTING\.md$|^UPDATING.md$|^dev/README\.md$|^dev/BACKPORT_PACKAGES.md$
|
2019-08-22 06:27:54 +03:00
|
|
|
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
|
2020-06-14 03:37:30 +03:00
|
|
|
rev: v3.1.0
|
2019-08-16 17:35:34 +03:00
|
|
|
hooks:
|
|
|
|
- id: check-merge-conflict
|
2019-11-26 11:28:42 +03:00
|
|
|
- id: debug-statements
|
2020-06-25 18:35:37 +03:00
|
|
|
- id: check-builtin-literals
|
2019-08-16 17:35:34 +03:00
|
|
|
- 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-12-28 21:34:35 +03:00
|
|
|
- id: trailing-whitespace
|
2020-02-04 11:44:35 +03:00
|
|
|
- id: fix-encoding-pragma
|
|
|
|
args:
|
|
|
|
- --remove
|
2019-09-21 22:47:02 +03:00
|
|
|
- repo: https://github.com/pre-commit/pygrep-hooks
|
2020-04-21 17:20:35 +03:00
|
|
|
rev: v1.5.1
|
2019-09-21 22:47:02 +03:00
|
|
|
hooks:
|
|
|
|
- id: rst-backticks
|
2019-09-22 10:55:39 +03:00
|
|
|
- id: python-no-log-warn
|
2020-06-14 03:37:30 +03:00
|
|
|
- repo: https://github.com/adrienverge/yamllint
|
|
|
|
rev: v1.23.0
|
2019-08-15 03:53:28 +03:00
|
|
|
hooks:
|
2019-08-22 17:13:56 +03:00
|
|
|
- id: yamllint
|
|
|
|
name: Check yaml files with yamllint
|
|
|
|
entry: yamllint -c yamllint-config.yml
|
|
|
|
types: [yaml]
|
2020-06-18 01:37:54 +03:00
|
|
|
exclude: ^.*init_git_sync\.template\.yaml$|^.*airflow\.template\.yaml$|^chart/templates/.*\.yaml$
|
2020-06-14 03:37:30 +03:00
|
|
|
- repo: https://github.com/timothycrosley/isort
|
2020-07-09 21:13:58 +03:00
|
|
|
rev: 5.0.6
|
2020-06-14 03:37:30 +03:00
|
|
|
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/.*$
|
2020-06-21 11:34:41 +03:00
|
|
|
- repo: https://github.com/pycqa/pydocstyle
|
|
|
|
rev: 5.0.2
|
|
|
|
hooks:
|
|
|
|
- id: pydocstyle
|
2020-06-21 11:51:57 +03:00
|
|
|
name: Run pydocstyle
|
2020-06-21 11:34:41 +03:00
|
|
|
args:
|
2020-06-21 11:51:57 +03:00
|
|
|
- --convention=pep257
|
2020-06-21 17:44:27 +03:00
|
|
|
- --add-ignore=D100,D102,D104,D105,D106,D107,D200,D202,D204,D205,D207,D208,D210,D400,D401,D403
|
2020-06-21 11:34:41 +03:00
|
|
|
exclude: ^tests/.*\.py$|^scripts/.*\.py$|^dev|^backport_packages|^kubernetes_tests
|
2020-06-14 03:37:30 +03:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
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
|
2020-01-07 22:38:24 +03:00
|
|
|
files: ^breeze$|^breeze-complete$|\.sh$|^hooks/build$|^hooks/push$|\.bash$|\.bats$
|
2020-06-01 22:46:15 +03:00
|
|
|
- id: lint-openapi
|
|
|
|
name: Lint OpenAPI using speccy
|
|
|
|
language: docker_image
|
|
|
|
entry: wework/speccy lint
|
2020-06-02 19:45:37 +03:00
|
|
|
files: ^airflow/api_connexion/openapi/
|
2020-06-01 22:46:15 +03:00
|
|
|
- id: lint-openapi
|
|
|
|
name: Lint OpenAPI using openapi-spec-validator
|
2020-06-02 19:45:37 +03:00
|
|
|
entry: openapi-spec-validator --schema 3.0.0
|
2020-06-01 22:46:15 +03:00
|
|
|
language: python
|
|
|
|
additional_dependencies: ['openapi-spec-validator']
|
2020-06-02 19:45:37 +03:00
|
|
|
files: ^airflow/api_connexion/openapi/
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: lint-dockerfile
|
|
|
|
name: Lint dockerfile
|
|
|
|
language: system
|
2019-09-18 14:43:30 +03:00
|
|
|
entry: "./scripts/ci/pre_commit_lint_dockerfile.sh"
|
2019-08-15 03:53:28 +03:00
|
|
|
files: ^Dockerfile.*$
|
2019-09-18 14:43:30 +03:00
|
|
|
pass_filenames: true
|
2019-11-30 12:05:14 +03:00
|
|
|
- id: setup-order
|
|
|
|
name: Checks for an order of dependencies in setup.py
|
|
|
|
language: python
|
|
|
|
files: ^setup.py$
|
|
|
|
pass_filenames: false
|
2020-05-26 13:58:24 +03:00
|
|
|
entry: ./scripts/ci/pre_commit_check_order_setup.py
|
2019-11-04 12:37:31 +03:00
|
|
|
- id: update-breeze-file
|
|
|
|
name: Update output of breeze command in BREEZE.rst
|
|
|
|
entry: "./scripts/ci/pre_commit_breeze_cmd_line.sh"
|
|
|
|
language: system
|
|
|
|
files: ^BREEZE.rst$|^breeze$|^breeze-complete$
|
|
|
|
pass_filenames: false
|
2020-03-07 20:12:28 +03:00
|
|
|
- id: update-local-yml-file
|
|
|
|
name: Update mounts in the local yml file
|
|
|
|
entry: "./scripts/ci/pre_commit_local_yml_mounts.sh"
|
|
|
|
language: system
|
2020-06-04 23:12:56 +03:00
|
|
|
files: ^scripts/ci/libraries/_local_mounts.sh$|s^scripts/ci/docker_compose/local.yml"
|
2020-03-07 20:12:28 +03:00
|
|
|
pass_filenames: false
|
2020-02-24 12:29:38 +03:00
|
|
|
- id: update-setup-cfg-file
|
|
|
|
name: Update setup.cfg file with all licenses
|
|
|
|
entry: "./scripts/ci/pre_commit_setup_cfg_file.sh"
|
|
|
|
language: system
|
|
|
|
files: ^setup.cfg$
|
|
|
|
pass_filenames: false
|
2020-03-07 22:55:27 +03:00
|
|
|
- id: build-providers-dependencies
|
|
|
|
name: Build cross-dependencies for providers packages
|
|
|
|
entry: "./scripts/ci/pre_commit_build_providers_dependencies.sh"
|
|
|
|
language: system
|
|
|
|
files: ^airflow/providers/.*\.py$|^tests/providers/.*\.py$
|
|
|
|
pass_filenames: false
|
2020-03-22 15:34:48 +03:00
|
|
|
- id: update-extras
|
|
|
|
name: Update extras in documentation
|
|
|
|
entry: "./scripts/ci/pre_commit_update_extras.sh"
|
|
|
|
language: system
|
|
|
|
files: ^setup.py$|^INSTALL$|^CONTRIBUTING.rst$
|
|
|
|
pass_filenames: false
|
2019-11-26 11:28:42 +03:00
|
|
|
- id: pydevd
|
|
|
|
language: pygrep
|
|
|
|
name: Check for pydevd debug statements accidentally left
|
|
|
|
entry: "pydevd.*settrace\\("
|
|
|
|
pass_filenames: true
|
|
|
|
files: \.py$
|
2020-06-09 00:27:02 +03:00
|
|
|
- id: dont-use-safe-filter
|
|
|
|
language: pygrep
|
|
|
|
name: Don't use safe in templates
|
|
|
|
description: the Safe filter is error-prone, use Markup() in code instead
|
|
|
|
entry: "\\|\\s*safe"
|
|
|
|
files: \.html$
|
|
|
|
pass_filenames: true
|
Don't use the term "whitelist" - language matters (#9174)
It's fairly common to say whitelisting and blacklisting to describe
desirable and undesirable things in cyber security. However just because
it is common doesn't mean it's right.
However, there's an issue with the terminology. It only makes sense if
you equate white with 'good, permitted, safe' and black with 'bad,
dangerous, forbidden'. There are some obvious problems with this.
You may not see why this matters. If you're not adversely affected by
racial stereotyping yourself, then please count yourself lucky. For some
of your friends and colleagues (and potential future colleagues), this
really is a change worth making.
From now on, we will use 'allow list' and 'deny list' in place of
'whitelist' and 'blacklist' wherever possible. Which, in fact, is
clearer and less ambiguous. So as well as being more inclusive of all,
this is a net benefit to our understandability.
(Words mostly borrowed from
<https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white>)
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-06-08 12:01:46 +03:00
|
|
|
- id: language-matters
|
|
|
|
language: pygrep
|
|
|
|
name: Check for language that we do not accept as community
|
|
|
|
description: Please use "deny_list" or "allow_list" instead.
|
|
|
|
entry: "(?i)(black|white)[_-]?list"
|
|
|
|
pass_filenames: true
|
|
|
|
exclude: >
|
|
|
|
(?x)
|
|
|
|
^airflow/providers/apache/cassandra/hooks/cassandra.py$|
|
|
|
|
^airflow/providers/apache/hive/operators/hive_stats.py$|
|
2020-06-16 23:55:42 +03:00
|
|
|
^airflow/providers/apache/hive/PROVIDERS_CHANGES_*|
|
|
|
|
^airflow/providers/apache/hive/README.md$|
|
Don't use the term "whitelist" - language matters (#9174)
It's fairly common to say whitelisting and blacklisting to describe
desirable and undesirable things in cyber security. However just because
it is common doesn't mean it's right.
However, there's an issue with the terminology. It only makes sense if
you equate white with 'good, permitted, safe' and black with 'bad,
dangerous, forbidden'. There are some obvious problems with this.
You may not see why this matters. If you're not adversely affected by
racial stereotyping yourself, then please count yourself lucky. For some
of your friends and colleagues (and potential future colleagues), this
really is a change worth making.
From now on, we will use 'allow list' and 'deny list' in place of
'whitelist' and 'blacklist' wherever possible. Which, in fact, is
clearer and less ambiguous. So as well as being more inclusive of all,
this is a net benefit to our understandability.
(Words mostly borrowed from
<https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white>)
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
2020-06-08 12:01:46 +03:00
|
|
|
^tests/providers/apache/cassandra/hooks/test_cassandra.py
|
2019-12-01 14:26:10 +03:00
|
|
|
- id: consistent-pylint
|
|
|
|
language: pygrep
|
|
|
|
name: Check for inconsitent pylint disable/enable without space
|
|
|
|
entry: "pylint:disable|pylint:enable"
|
|
|
|
pass_filenames: true
|
|
|
|
files: \.py$
|
2019-11-27 01:19:45 +03:00
|
|
|
- id: base-operator
|
|
|
|
language: pygrep
|
2019-12-29 23:17:56 +03:00
|
|
|
name: Make sure BaseOperator[Link] is imported from airflow.models.baseoperator in core
|
2019-12-01 13:14:52 +03:00
|
|
|
entry: "from airflow\\.models import.* BaseOperator"
|
2019-11-27 01:19:45 +03:00
|
|
|
files: \.py$
|
|
|
|
pass_filenames: true
|
|
|
|
exclude: >
|
|
|
|
(?x)
|
|
|
|
^airflow/gcp/.*$|
|
|
|
|
^airflow/hooks/.*$|
|
|
|
|
^airflow/operators/.*$|
|
|
|
|
^airflow/sensors/.*$|
|
|
|
|
^airflow/providers/.*$|
|
2020-05-26 03:43:16 +03:00
|
|
|
^backport_packages/.*$
|
2019-11-27 01:19:45 +03:00
|
|
|
- id: base-operator
|
|
|
|
language: pygrep
|
2019-12-29 23:17:56 +03:00
|
|
|
name: Make sure BaseOperator[Link] is imported from airflow.models outside of core
|
2019-12-01 13:14:52 +03:00
|
|
|
entry: "from airflow\\.models\\.baseoperator import.* BaseOperator"
|
2019-11-27 01:19:45 +03:00
|
|
|
pass_filenames: true
|
|
|
|
files: >
|
|
|
|
(?x)
|
|
|
|
^airflow/gcp/.*$|
|
|
|
|
^airflow/hooks/.*$|
|
|
|
|
^airflow/operators/.*$|
|
|
|
|
^airflow/sensors/.*$|
|
2020-06-29 09:08:58 +03:00
|
|
|
^airflow/providers/.*\.py$
|
2020-02-02 12:14:14 +03:00
|
|
|
- id: provide-create-sessions
|
|
|
|
language: pygrep
|
2020-05-15 20:00:15 +03:00
|
|
|
name: To avoid import cycles make sure provide_session and create_session are imported from
|
|
|
|
airflow.utils.session
|
2020-02-02 12:14:14 +03:00
|
|
|
entry: "from airflow\\.utils\\.db import.* (provide_session|create_session)"
|
|
|
|
files: \.py$
|
|
|
|
pass_filenames: true
|
2020-02-02 22:48:03 +03:00
|
|
|
- id: incorrect-use-of-LoggingMixin
|
|
|
|
language: pygrep
|
|
|
|
name: Make sure LoggingMixin is not used alone
|
|
|
|
entry: "LoggingMixin\\(\\)"
|
|
|
|
files: \.py$
|
|
|
|
pass_filenames: true
|
2020-02-03 00:55:49 +03:00
|
|
|
- id: daysago-import-check
|
|
|
|
language: pygrep
|
|
|
|
name: Make sure days_ago is imported from airflow.utils.dates
|
|
|
|
entry: "(airflow\\.){0,1}utils\\.dates\\.days_ago"
|
|
|
|
files: \.py$
|
|
|
|
pass_filenames: true
|
2020-04-22 15:38:56 +03:00
|
|
|
- id: check-integrations
|
|
|
|
name: Check if integration list is aligned
|
|
|
|
entry: ./scripts/ci/pre_commit_check_integrations.sh
|
|
|
|
language: system
|
|
|
|
pass_filenames: false
|
|
|
|
files: ^common/_common_values.sh$|^breeze-complete$
|
2019-11-04 17:59:48 +03:00
|
|
|
- id: build
|
|
|
|
name: Check if image build is needed
|
2020-03-27 17:27:53 +03:00
|
|
|
entry: ./scripts/ci/pre_commit_ci_build.sh 3.6 false
|
2019-11-04 17:59:48 +03:00
|
|
|
language: system
|
|
|
|
always_run: true
|
|
|
|
pass_filenames: false
|
|
|
|
- id: check-apache-license
|
|
|
|
name: Check if licenses are OK for Apache
|
|
|
|
entry: "./scripts/ci/pre_commit_check_license.sh"
|
|
|
|
language: system
|
|
|
|
files: ^.*LICENSE.*$|^.*LICENCE.*$
|
|
|
|
pass_filenames: false
|
2020-01-09 00:48:22 +03:00
|
|
|
- id: airflow-config-yaml
|
|
|
|
name: Checks for consistency between config.yml and default_config.cfg
|
|
|
|
language: python
|
2020-03-14 10:10:59 +03:00
|
|
|
files: "config.yml$|default_airflow.cfg$|default.cfg$"
|
2020-01-09 00:48:22 +03:00
|
|
|
pass_filenames: false
|
|
|
|
require_serial: false
|
2020-05-26 13:58:24 +03:00
|
|
|
entry: ./scripts/ci/pre_commit_yaml_to_cfg.py
|
2020-01-09 00:48:22 +03:00
|
|
|
additional_dependencies: ['pyyaml']
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: mypy
|
|
|
|
name: Run mypy
|
|
|
|
language: system
|
2019-09-18 14:43:30 +03:00
|
|
|
entry: "./scripts/ci/pre_commit_mypy.sh"
|
2019-08-15 03:53:28 +03:00
|
|
|
files: \.py$
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^dev|^backport_packages
|
2020-02-19 23:20:59 +03:00
|
|
|
require_serial: true
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: pylint
|
|
|
|
name: Run pylint for main sources
|
|
|
|
language: system
|
2019-09-18 14:43:30 +03:00
|
|
|
entry: "./scripts/ci/pre_commit_pylint_main.sh"
|
2019-08-15 03:53:28 +03:00
|
|
|
files: \.py$
|
2020-06-04 17:45:29 +03:00
|
|
|
exclude: ^tests/.*\.py$|^scripts/.*\.py$|^dev|^backport_packages|^kubernetes_tests
|
2019-09-18 14:43:30 +03:00
|
|
|
pass_filenames: true
|
2019-12-03 18:02:20 +03:00
|
|
|
require_serial: true # Pylint tests should be run in one chunk to detect all cycles
|
|
|
|
- id: pylint-tests
|
2019-08-15 03:53:28 +03:00
|
|
|
name: Run pylint for tests
|
|
|
|
language: system
|
2019-09-18 14:43:30 +03:00
|
|
|
entry: "./scripts/ci/pre_commit_pylint_tests.sh"
|
2019-08-15 03:53:28 +03:00
|
|
|
files: ^tests/.*\.py$
|
2019-09-18 14:43:30 +03:00
|
|
|
pass_filenames: true
|
2020-01-25 17:06:27 +03:00
|
|
|
require_serial: true
|
2019-08-15 03:53:28 +03:00
|
|
|
- id: flake8
|
|
|
|
name: Run flake8
|
|
|
|
language: system
|
2019-09-18 14:43:30 +03:00
|
|
|
entry: "./scripts/ci/pre_commit_flake8.sh"
|
2019-08-15 03:53:28 +03:00
|
|
|
files: \.py$
|
2019-09-18 14:43:30 +03:00
|
|
|
pass_filenames: true
|
2020-01-07 17:38:05 +03:00
|
|
|
- id: bat-tests
|
2020-01-19 15:15:43 +03:00
|
|
|
name: Run BATS bash tests for changed bash files
|
2020-01-07 17:38:05 +03:00
|
|
|
language: system
|
|
|
|
entry: "./scripts/ci/pre_commit_bat_tests.sh"
|
2020-01-19 15:15:43 +03:00
|
|
|
files: ^breeze$|^breeze-complete$|\.sh$|\.bash$
|
|
|
|
pass_filenames: false
|
2020-04-09 23:50:17 +03:00
|
|
|
- id: stylelint
|
|
|
|
name: stylelint
|
|
|
|
entry: "stylelint"
|
|
|
|
language: node
|
|
|
|
files: ^airflow/www/.*\.(css|scss|sass)$
|
|
|
|
# Keep dependency versions in sync w/ airflow/www/package.json
|
|
|
|
additional_dependencies: ['stylelint@13.3.1', 'stylelint-config-standard@20.0.0']
|