Removed JUtility.h and added './tp format'

This commit is contained in:
Julgodis
2021-09-26 12:11:21 +02:00
parent fa19d7a32e
commit bf12ea7a11
11 changed files with 60 additions and 82 deletions
+40 -15
View File
@@ -343,6 +343,31 @@ def remove_unused_asm():
text.stylize("bold green")
CONSOLE.print(text)
@tp.command(name="format")
@click.option('--debug/--no-debug')
@click.option('--thread-count', '-j', 'thread_count', help="This option is passed forward to all 'make' commands.", default=4)
@click.option('--game-path', default=DEFAULT_GAME_PATH, required=True)
@click.option('--build-path', default=DEFAULT_BUILD_PATH, required=True)
def format(debug, thread_count, game_path, build_path):
""" Format all .cpp/.h files using clang-format """
if debug:
LOG.setLevel(logging.DEBUG)
text = Text("--- Clang-Format")
text.stylize("bold magenta")
CONSOLE.print(text)
if clang_format(thread_count):
text = Text(" OK")
text.stylize("bold green")
CONSOLE.print(text)
else:
text = Text(" ERR")
text.stylize("bold red")
CONSOLE.print(text)
sys.exit(1)
@tp.command(name="pull-request")
@click.option('--debug/--no-debug')
@click.option('--thread-count', '-j', 'thread_count', help="This option is passed forward to all 'make' commands.", default=4)
@@ -360,6 +385,21 @@ def pull_request(debug, thread_count, game_path, build_path):
remove_unused_asm()
#
text = Text("--- Clang-Format")
text.stylize("bold magenta")
CONSOLE.print(text)
if clang_format(thread_count):
text = Text(" OK")
text.stylize("bold green")
CONSOLE.print(text)
else:
text = Text(" ERR")
text.stylize("bold red")
CONSOLE.print(text)
sys.exit(1)
#
text = Text("--- Full Rebuild")
text.stylize("bold magenta")
@@ -392,21 +432,6 @@ def pull_request(debug, thread_count, game_path, build_path):
CONSOLE.print(text)
sys.exit(1)
#
text = Text("--- Clang-Format")
text.stylize("bold magenta")
CONSOLE.print(text)
if clang_format(thread_count):
text = Text(" OK")
text.stylize("bold green")
CONSOLE.print(text)
else:
text = Text(" ERR")
text.stylize("bold red")
CONSOLE.print(text)
sys.exit(1)
#
text = Text("--- Calculate Progress")
text.stylize("bold magenta")