Skip to content

Commit

Permalink
format: add --api-prefix CLI option (envoyproxy#3108)
Browse files Browse the repository at this point in the history
Needed for checking format when embedded in a parent project.

Signed-off-by: Matt Klein <[email protected]>
  • Loading branch information
mattklein123 authored Apr 17, 2018
1 parent ca111bc commit 762ebd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def checkProtobufExternalDeps(file_path):


def isApiFile(file_path):
return file_path.startswith('./api/')
return file_path.startswith(args.api_prefix)


def isBuildFile(file_path):
Expand Down Expand Up @@ -291,6 +291,7 @@ def checkFormatVisitor(arg, dir_name, names):
parser.add_argument('--add-excluded-prefixes', type=str, nargs="+", help="exclude additional prefixes.")
parser.add_argument('-j', '--num-workers', type=int, default=multiprocessing.cpu_count(),
help="number of worker processes to use; defaults to one per core.")
parser.add_argument('--api-prefix', type=str, default='./api/', help="path of the API tree")
args = parser.parse_args()

operation_type = args.operation_type
Expand Down

0 comments on commit 762ebd1

Please sign in to comment.