Skip to content

Commit

Permalink
Rename pre-commit scripts, drop pre_commit_ prefix (#38667)
Browse files Browse the repository at this point in the history
We don't reference those scripts only by name anywhere (always by the
full path or the pre-commit ID). The pre-commit part is already evident
from them being inside a pre_commit directory. This makes paths shorter
and those files a bit easier to browse in a file browser (including ls).

(cherry picked from commit 725a9b6)
  • Loading branch information
uranusjr authored and potiuk committed Apr 6, 2024
1 parent b38575a commit 35684a8
Show file tree
Hide file tree
Showing 83 changed files with 104 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}"
shell: bash
run: |
pip install rich>=12.4.4 pyyaml
python scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py
python scripts/ci/pre_commit/update_providers_dependencies.py
if: inputs.do-build == 'true' && inputs.upgrade-to-newer-dependencies != 'false'
- name: "Start ARM instance"
run: ./scripts/ci/images/ci_start_arm_instance_and_connect_to_docker.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prod-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ ${{ inputs.do-build == 'true' && inputs.image-tag || '' }}"
shell: bash
run: |
pip install rich>=12.4.4 pyyaml
python scripts/ci/pre_commit/pre_commit_update_providers_dependencies.py
python scripts/ci/pre_commit/update_providers_dependencies.py
if: inputs.do-build == 'true' && inputs.upgrade-to-newer-dependencies != 'false'
- name: "Cleanup dist and context file"
shell: bash
Expand Down
182 changes: 91 additions & 91 deletions .pre-commit-config.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ packages:

Apache Airflow version life cycle:

<!-- This table is automatically updated by pre-commit scripts/ci/pre_commit/pre_commit_supported_versions.py -->
<!-- This table is automatically updated by pre-commit scripts/ci/pre_commit/supported_versions.py -->
<!-- Beginning of auto-generated table -->

| Version | Current Patch/Minor | State | First Release | Limited Support | EOL/Terminated |
Expand Down
2 changes: 1 addition & 1 deletion contributing-docs/05_pull_requests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ In such cases we can usually do something like this
self.my_field = my_field
The reason for doing it is that we are working on a cleaning up our code to have
`pre-commit hook <../scripts/ci/pre_commit/pre_commit_validate_operators_init.py>`__
`pre-commit hook <../scripts/ci/pre_commit/validate_operators_init.py>`__
that will make sure all the cases where logic (such as validation and complex conversion)
is not done in the constructor are detected in PRs.

Expand Down
4 changes: 2 additions & 2 deletions dev/README_RELEASE_AIRFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ The Release Candidate artifacts we vote upon should be the exact ones we vote ag
```

- Set your version in `airflow/__init__.py`, `airflow/api_connexion/openapi/v1.yaml` and `docs/` (without the RC tag).
- Add supported Airflow version to `./scripts/ci/pre_commit/pre_commit_supported_versions.py` and let pre-commit do the job.
- Add supported Airflow version to `./scripts/ci/pre_commit/supported_versions.py` and let pre-commit do the job.
- Replace the version in `README.md` and verify that installation instructions work fine.
- Add entry for default python version to `BASE_PROVIDERS_COMPATIBILITY_CHECKS` in `src/airflow_breeze/global_constants.py`
with the new Airflow version, and empty exclusion for providers. This list should be updated later when providers
Expand Down Expand Up @@ -1010,7 +1010,7 @@ EOF
This includes:
- Modify `./scripts/ci/pre_commit/pre_commit_supported_versions.py` and let pre-commit do the job.
- Modify `./scripts/ci/pre_commit/supported_versions.py` and let pre-commit do the job.
- For major/minor release, update version in `airflow/__init__.py`, `docs/docker-stack/` and `airflow/api_connexion/openapi/v1.yaml` to the next likely minor version release.
- Sync `RELEASE_NOTES.rst` (including deleting relevant `newsfragments`) and `README.md` changes.
- Updating `Dockerfile` with the new version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def run_build_ci_image(
/ "scripts"
/ "ci"
/ "pre_commit"
/ "pre_commit_update_providers_dependencies.py"
/ "update_providers_dependencies.py"
),
],
check=False,
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/src/airflow_breeze/utils/md5_build_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def calculate_md5_checksum_for_files(
/ "scripts"
/ "ci"
/ "pre_commit"
/ "pre_commit_update_providers_dependencies.py"
/ "update_providers_dependencies.py"
),
],
cwd=AIRFLOW_SOURCES_ROOT,
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/database-erd-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ Here is the current Database schema diagram.
`db command <cli-and-env-variables-ref.html#db>`_ for the commands that you can use to manage
the migrations.

.. This image is automatically generated by pre-commit via ``scripts/ci/pre_commit/pre_commit_update_er_diagram.py``
.. This image is automatically generated by pre-commit via ``scripts/ci/pre_commit/update_er_diagram.py``
.. image:: img/airflow_erd.svg
2 changes: 1 addition & 1 deletion docs/apache-airflow/installation/supported-versions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Version Life Cycle

Apache Airflow™ version life cycle:

.. This table is automatically updated by pre-commit scripts/ci/pre_commit/pre_commit_supported_versions.py
.. This table is automatically updated by pre-commit scripts/ci/pre_commit/supported_versions.py
.. Beginning of auto-generated table
========= ===================== ========= =============== ================= ================
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/migrations-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here's the list of all the Database Migrations that are executed via when you ru



.. This table is automatically updated by pre-commit by ``scripts/ci/pre_commit/pre_commit_migration_reference.py``
.. This table is automatically updated by pre-commit by ``scripts/ci/pre_commit/migration_reference.py``
.. All table elements are scraped from migration files
.. Beginning of auto-generated table
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
if not any(file.startswith(f"tests/{folder}/") for folder in POSSIBLE_TEST_FOLDERS):
console.print(
"[red]The file is in a wrong folder. Make sure to move it to the right folder "
"listed in `./script/ci/pre_commit/pre_commit_check_tests_in_right_folders.py` "
"listed in `./script/ci/pre_commit/check_tests_in_right_folders.py` "
"or create new folder and add it to the script if you know what you are doing.[/]"
)
console.print(file)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def sorting_key(filen):
if not match:
print(
f"_REVISION_HEADS_MAP not found in {DB_FILE}. If this has been removed intentionally, "
"please update scripts/ci/pre_commit/pre_commit_version_heads_map.py"
"please update scripts/ci/pre_commit/version_heads_map.py"
)
sys.exit(1)

Expand Down
File renamed without changes.

0 comments on commit 35684a8

Please sign in to comment.