Skip to content

Commit

Permalink
fix: add pre-commit to ban urlparse (apache#27841)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonhyeongseo authored Feb 20, 2023
1 parent cd01650 commit a99254f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ repos:
pass_filenames: true
files: \.py$
exclude: ^airflow/_vendor/|^docs/|^tests/
- id: check-urlparse-usage-in-code
language: pygrep
name: Don't use urlparse in code
description: urlparse is not recommended, use urlsplit() in code instead
entry: "^\\s*from urllib\\.parse import ((\\|, )(urlparse\\|urlunparse))+$"
pass_filenames: true
files: \.py$
- id: check-only-new-session-with-provide-session
name: Check NEW_SESSION is only used with @provide_session
language: python
Expand Down
2 changes: 2 additions & 0 deletions STATIC_CODE_CHECKS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ require Breeze Docker image to be build locally.
+-----------------------------------------------------------+------------------------------------------------------------------+---------+
| check-system-tests-tocs | Check that system tests is properly added | |
+-----------------------------------------------------------+------------------------------------------------------------------+---------+
| check-urlparse-usage-in-code | Don't use urlparse in code | |
+-----------------------------------------------------------+------------------------------------------------------------------+---------+
| check-xml | Check XML files with xmllint | |
+-----------------------------------------------------------+------------------------------------------------------------------+---------+
| codespell | Run codespell to check for common misspellings in files | |
Expand Down
1 change: 1 addition & 0 deletions dev/breeze/src/airflow_breeze/pre_commit_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"check-start-date-not-used-in-defaults",
"check-system-tests-present",
"check-system-tests-tocs",
"check-urlparse-usage-in-code",
"check-xml",
"codespell",
"compile-www-assets",
Expand Down
2 changes: 1 addition & 1 deletion images/breeze/output-commands-hash.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ setup:version:123b462a421884dc2320ffc5e54b2478
setup:56a2ef337c354362760d247df5d05365
shell:ab07ac2d57253e25367a7200ce686703
start-airflow:5e8460ac38f8e9ea2a0ac7e248fd7bc9
static-checks:12e8fed2acbed0d823efc5121fd0eb58
static-checks:af6504875660e76e870967ffb43f1724
stop:e5aa686b4e53707ced4039d8414d5cd6
testing:docker-compose-tests:b86c044b24138af0659a05ed6331576c
testing:helm-tests:94a442e7f3f63b34c4831a84d165690a
Expand Down
14 changes: 7 additions & 7 deletions images/breeze/output_static-checks.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a99254f

Please sign in to comment.