From 2e246a936f636ca4e1cb115699d1d35fca9bbf63 Mon Sep 17 00:00:00 2001 From: Elliott Jin Date: Sun, 19 Mar 2017 13:02:58 -0700 Subject: [PATCH] tools: Support checking specific files in `check-templates`. --- tools/check-templates | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/check-templates b/tools/check-templates index 93b1bffd5e..603eaf4218 100755 --- a/tools/check-templates +++ b/tools/check-templates @@ -22,11 +22,12 @@ EXCLUDED_FILES = [ "tools/tests/test_template_data", ] -def check_our_files(modified_only, all_dups): - # type: (bool, bool) -> None +def check_our_files(modified_only, all_dups, targets): + # type: (bool, bool, List[str]) -> None by_lang = cast( Dict[str, List[str]], lister.list_files( + targets=targets, modified_only=args.modified, ftypes=['handlebars', 'html'], group_by_ftype=True, exclude=EXCLUDED_FILES)) @@ -243,5 +244,6 @@ if __name__ == '__main__': parser.add_argument('--all-dups', action="store_true", default=False, help='Run lint tool to detect duplicate ids on ignored files as well') + parser.add_argument('targets', nargs=argparse.REMAINDER) args = parser.parse_args() - check_our_files(args.modified, args.all_dups) + check_our_files(args.modified, args.all_dups, args.targets)