Skip to content

Commit

Permalink
Cleans up pre-commits a little (#16547)
Browse files Browse the repository at this point in the history
Few cleanups of pre-commits:

* moving non-image-dependent pre-commits before image building
* add setuptools as requirement for provider's dependency pre-commit
* force python 3.6 for all image-dependent pre-commits
  • Loading branch information
potiuk committed Jun 20, 2021
1 parent 15baf73 commit 1e56420
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
43 changes: 22 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ repos:
- id: build-providers-dependencies
name: Build cross-dependencies for providers packages
entry: ./scripts/ci/pre_commit/pre_commit_build_providers_dependencies.sh
language: system
language: python
files: ^airflow/providers/.*\.py$|^tests/providers/.*\.py$
pass_filenames: false
additional_dependencies: ['setuptools']
- id: update-extras
name: Update extras in documentation
entry: ./scripts/ci/pre_commit/pre_commit_insert_extras.py
Expand Down Expand Up @@ -629,6 +630,26 @@ repos:
additional_dependencies: ['flynt==0.63']
files: \.py$
exclude: ^airflow/_vendor/
- id: ui-lint
name: ESLint against airflow/ui
language: node
'types_or': [javascript, tsx, ts]
files: ^airflow/ui/
entry: scripts/ci/static_checks/ui_lint.sh
pass_filenames: false
- id: www-lint
name: ESLint against current UI js files
language: node
'types_or': [javascript]
files: ^airflow/www/static/js/
entry: scripts/ci/static_checks/www_lint.sh
pass_filenames: false
- id: bats-in-container-tests
name: Run in container bats tests
language: system
entry: ./scripts/ci/pre_commit/pre_commit_in_container_bats_test.sh
files: ^tests/bats/in_container/.*\.bats$|^scripts/in_container/.*sh
pass_filenames: false
## ADD MOST PRE-COMMITS ABOVE THAT LINE
# The below pre-commits are those requiring CI image to be built
- id: build
Expand Down Expand Up @@ -685,24 +706,4 @@ repos:
files: \.py$
pass_filenames: true
exclude: ^airflow/_vendor/
- id: ui-lint
name: ESLint against airflow/ui
language: node
'types_or': [javascript, tsx, ts]
files: ^airflow/ui/
entry: scripts/ci/static_checks/ui_lint.sh
pass_filenames: false
- id: www-lint
name: ESLint against current UI js files
language: node
'types_or': [javascript]
files: ^airflow/www/static/js/
entry: scripts/ci/static_checks/www_lint.sh
pass_filenames: false
- id: bats-in-container-tests
name: Run in container bats tests
language: system
entry: ./scripts/ci/pre_commit/pre_commit_in_container_bats_test.sh
files: ^tests/bats/in_container/.*\.bats$|^scripts/in_container/.*sh
pass_filenames: false
## ONLY ADD PRE-COMMITS HERE THAT REQUIRE CI IMAGE
1 change: 1 addition & 0 deletions scripts/ci/pre_commit/pre_commit_flake8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
export PYTHON_MAJOR_MINOR_VERSION="3.6"
export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
export REMEMBER_LAST_ANSWER="true"
export PRINT_INFO_FROM_SCRIPTS="false"
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/pre_commit/pre_commit_mypy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
export PYTHON_MAJOR_MINOR_VERSION="3.6"
export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
export REMEMBER_LAST_ANSWER="true"
export PRINT_INFO_FROM_SCRIPTS="false"
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/pre_commit/pre_commit_pylint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
export PYTHON_MAJOR_MINOR_VERSION="3.6"
export FORCE_ANSWER_TO_QUESTIONS=${FORCE_ANSWER_TO_QUESTIONS:="quit"}
export REMEMBER_LAST_ANSWER="true"
export PRINT_INFO_FROM_SCRIPTS="false"
Expand Down

0 comments on commit 1e56420

Please sign in to comment.