Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/local/butler/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@

from local.butler import common


FIRST_PARTY_MODULES = [
'handlers',
'libs',
'clusterfuzz',
]

ISORT_CMD = ('isort --dont-order-by-type --force-single-line-imports '
'--force-sort-within-sections --line-length=80 ' + ' '.join(
[f'-p {mod}' for mod in FIRST_PARTY_MODULES]) + ' ')
'--force-sort-within-sections --line-length=80 ' +
' '.join([f'-p {mod}' for mod in FIRST_PARTY_MODULES]) + ' ')


def execute(args):
Expand All @@ -48,7 +49,7 @@ def execute(args):
not f.endswith('_pb2.py') and not f.endswith('_pb2_grpc.py')
]
if py_changed_file_paths:
common.execute(f'yapf -p -i {" ".join(py_changed_file_paths)}')
common.execute(f'yapf -p -i --style yapf {" ".join(py_changed_file_paths)}')
common.execute(f'{ISORT_CMD} {" ".join(py_changed_file_paths)}')
go_changed_file_paths = [f for f in file_paths if f.endswith('.go')]

Expand Down
2 changes: 1 addition & 1 deletion src/local/butler/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def execute(args):
py_changed_file_paths = py_changed_nontests + py_changed_tests
if py_changed_file_paths:
joined_paths = " ".join(py_changed_file_paths)
_execute_command_and_track_error(f'yapf -p -d {joined_paths}')
_execute_command_and_track_error(f'yapf -p -d --style yapf {joined_paths}')
_execute_command_and_track_error(f'{formatter.ISORT_CMD} -c {joined_paths}')
if args.type_check:
_execute_command_and_track_error(f'pyright {joined_paths}')
Expand Down
Loading