mirror of
https://github.com/zeldaret/tp
synced 2026-06-10 20:59:01 -04:00
Removed JUtility.h and added './tp format'
This commit is contained in:
+40
-15
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user