From 24ab5b08a357829307432158a1e4252eefc2c6db Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Mon, 22 Mar 2021 06:14:22 -0700 Subject: [PATCH] [makefile] autogenerate target (#10814) * autogenerate target * clarify comment --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b659fcb546a..9ef8e2659d8 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,11 @@ modified_only_fixup: 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 extra_quality_checks: @@ -37,20 +42,20 @@ quality: # 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/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: black $(check_dirs) isort $(check_dirs) + ${MAKE} autogenerate_code ${MAKE} extra_style_checks # 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 @@ -87,4 +92,3 @@ post-release: post-patch: python utils/release.py --post_release --patch -