From 222dbdc022ecc1d95edef578e8252b4dee320ccc Mon Sep 17 00:00:00 2001 From: John Bampton Date: Tue, 26 Nov 2024 04:37:00 +1000 Subject: [PATCH] Clean up the pre-commit config (#44347) --- .pre-commit-config.yaml | 46 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index adcd46f6244ae..e746b1449602d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1274,13 +1274,14 @@ repos: # These migrations contain FAB related changes but existed before moving FAB auth manager # to its own provider exclude: > - (?ix) - ^airflow/migrations/versions/00.*\.py$| - ^airflow/migrations/versions/0106.*\.py$| - ^airflow/migrations/versions/0118.*\.py$| - ^airflow/migrations/versions/0119.*\.py$| - ^airflow/migrations/versions/0121.*\.py$| - ^airflow/migrations/versions/0124.*\.py$ + (?ix)^( + airflow/migrations/versions/00.*\.py| + airflow/migrations/versions/0106.*\.py| + airflow/migrations/versions/0118.*\.py| + airflow/migrations/versions/0119.*\.py| + airflow/migrations/versions/0121.*\.py| + airflow/migrations/versions/0124.*\.py + )$ ## ADD MOST PRE-COMMITS ABOVE THAT LINE # The below pre-commits are those requiring CI image to be built - id: mypy-dev @@ -1298,36 +1299,37 @@ repos: pass_filenames: false files: ^.*\.py$ require_serial: true - additional_dependencies: [ 'rich>=12.4.4' ] + additional_dependencies: ['rich>=12.4.4'] - id: mypy-airflow name: Run mypy for airflow language: python entry: ./scripts/ci/pre_commit/mypy.py files: \.py$ exclude: | - (?x) - ^.*/.*_vendor/ | - ^airflow/migrations | - ^providers/ | - ^task_sdk/ | - ^dev | - ^scripts | - ^docs | - ^provider_packages | - ^performance/ | - ^tests/dags/test_imports.py | - ^clients/python/test_.*\.py + (?x)^( + .*/.*_vendor/| + airflow/migrations| + clients/python/test_.*\.py| + dev| + docs| + performance/| + provider_packages| + providers/| + scripts| + task_sdk/| + tests/dags/test_imports\.py + ) require_serial: true additional_dependencies: ['rich>=12.4.4'] - id: mypy-airflow - stages: [ 'manual' ] + stages: ['manual'] name: Run mypy for airflow (manual) language: python entry: ./scripts/ci/pre_commit/mypy_folder.py airflow pass_filenames: false files: ^.*\.py$ require_serial: true - additional_dependencies: [ 'rich>=12.4.4' ] + additional_dependencies: ['rich>=12.4.4'] - id: mypy-providers name: Run mypy for providers language: python