Unverified Commit e68ff304 authored by Arthur's avatar Arthur Committed by GitHub
Browse files

[`quality`] update quality check to make sure we check imports 😈 (#29771)

* update quality check

* make it nice

* update

* let's make sure it runs and we have the logs actually

* update workflow

* nits
parent fadb0533
...@@ -157,6 +157,7 @@ jobs: ...@@ -157,6 +157,7 @@ jobs:
command: pip freeze | tee installed.txt command: pip freeze | tee installed.txt
- store_artifacts: - store_artifacts:
path: ~/transformers/installed.txt path: ~/transformers/installed.txt
- run: python -c "from transformers import *" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1)
- run: ruff check examples tests src utils - run: ruff check examples tests src utils
- run: ruff format tests src utils --check - run: ruff format tests src utils --check
- run: python utils/custom_init_isort.py --check_only - run: python utils/custom_init_isort.py --check_only
......
...@@ -51,12 +51,14 @@ repo-consistency: ...@@ -51,12 +51,14 @@ repo-consistency:
# this target runs checks on all files # this target runs checks on all files
quality: quality:
@python -c "from transformers import *" || (echo '🚨 import failed, this means you introduced unprotected imports! 🚨'; exit 1)
ruff check $(check_dirs) setup.py conftest.py ruff check $(check_dirs) setup.py conftest.py
ruff format --check $(check_dirs) setup.py conftest.py ruff format --check $(check_dirs) setup.py conftest.py
python utils/custom_init_isort.py --check_only python utils/custom_init_isort.py --check_only
python utils/sort_auto_mappings.py --check_only python utils/sort_auto_mappings.py --check_only
python utils/check_doc_toc.py python utils/check_doc_toc.py
# Format source code automatically and check is there are any problems left that need manual fixing # Format source code automatically and check is there are any problems left that need manual fixing
extra_style_checks: extra_style_checks:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment