diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index 36441ac7256c9..311efac16a3d8 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -1220,9 +1220,10 @@ def owned_directories(error_messages): # Calculate the list of owned directories once per run. error_messages = [] owned_directories = owned_directories(error_messages) - if os.path.isfile(args.target_path): - error_messages += format_checker.check_format("./" + args.target_path) + if not args.target_path.startswith(EXCLUDED_PREFIXES) and args.target_path.endswith( + SUFFIXES): + error_messages += format_checker.check_format("./" + args.target_path) else: results = [] diff --git a/tools/code_format/python_check.py b/tools/code_format/python_check.py index 9f4a556b62e8e..512576bfec7cb 100755 --- a/tools/code_format/python_check.py +++ b/tools/code_format/python_check.py @@ -8,7 +8,7 @@ # # alternatively, if you have the necessary python deps available # -# ./tools/code_format/python_check.py -h +# PYTHONPATH=. ./tools/code_format/python_check.py -h # # python requires: flake8, yapf #