[makefile] autogenerate target (#10814)

* autogenerate target

* clarify comment
This commit is contained in:
Stas Bekman 2021-03-22 06:14:22 -07:00 committed by GitHub
parent 2c6684239f
commit 24ab5b08a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,11 @@ modified_only_fixup:
deps_table_update: deps_table_update:
@python setup.py deps_table_update @python setup.py deps_table_update
# autogenerating code
autogenerate_code: deps_table_update
python utils/class_mapping_update.py
# Check that source code meets quality standards # Check that source code meets quality standards
extra_quality_checks: extra_quality_checks:
@ -37,20 +42,20 @@ quality:
# 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: deps_table_update extra_style_checks:
python utils/custom_init_isort.py python utils/custom_init_isort.py
python utils/style_doc.py src/transformers docs/source --max_len 119 python utils/style_doc.py src/transformers docs/source --max_len 119
python utils/class_mapping_update.py
# this target runs checks on all files # this target runs checks on all files and potentially modifies some of them
style: style:
black $(check_dirs) black $(check_dirs)
isort $(check_dirs) isort $(check_dirs)
${MAKE} autogenerate_code
${MAKE} extra_style_checks ${MAKE} extra_style_checks
# Super fast fix and check target that only works on relevant modified files since the branch was made # Super fast fix and check target that only works on relevant modified files since the branch was made
fixup: modified_only_fixup extra_style_checks extra_quality_checks fixup: modified_only_fixup extra_style_checks autogenerate_code extra_quality_checks
# Make marked copies of snippets of codes conform to the original # Make marked copies of snippets of codes conform to the original
@ -87,4 +92,3 @@ post-release:
post-patch: post-patch:
python utils/release.py --post_release --patch python utils/release.py --post_release --patch