tools: Support checking specific files in `check-templates`.

This commit is contained in:
Elliott Jin 2017-03-19 13:02:58 -07:00 committed by Tim Abbott
parent 357e1a001f
commit 2e246a936f
1 changed files with 5 additions and 3 deletions

View File

@ -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)