From 2a6e245e2abc3bcb35c81b137d5dfc34d0fb6d4a Mon Sep 17 00:00:00 2001 From: Gerwin Klein Date: Wed, 3 Feb 2021 17:21:09 +1100 Subject: [PATCH] trivial: run style formatter Signed-off-by: Gerwin Klein --- cmake-tool/helpers/cakeml.cmake | 3 +-- cmake-tool/helpers/cpio.cmake | 7 +++++-- cmake-tool/simulate_scripts/launch_gdb.py | 5 ++++- misc/filter.py | 6 ++++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmake-tool/helpers/cakeml.cmake b/cmake-tool/helpers/cakeml.cmake index 52fe43eb..197b636f 100644 --- a/cmake-tool/helpers/cakeml.cmake +++ b/cmake-tool/helpers/cakeml.cmake @@ -179,8 +179,7 @@ function(DeclareCakeMLLib library_name) "${HOLMAKEFILE}" ${PARSE_CML_LIB_DEPENDS} WORKING_DIRECTORY "${CML_DIR}" - VERBATIM - ${USES_TERMINAL_DEBUG} + VERBATIM ${USES_TERMINAL_DEBUG} ) add_custom_target(${library_name}cakeml_asm_theory_target DEPENDS "${ASM_FILE}") add_library(${library_name} STATIC EXCLUDE_FROM_ALL "${ASM_FILE}") diff --git a/cmake-tool/helpers/cpio.cmake b/cmake-tool/helpers/cpio.cmake index 6f8cbdb6..ab0131eb 100644 --- a/cmake-tool/helpers/cpio.cmake +++ b/cmake-tool/helpers/cpio.cmake @@ -46,7 +46,10 @@ function(MakeCPIO output_name input_files) # Check that the reproducible flag is available. Don't use it if it isn't. CheckCPIOArgument(cpio_reproducible_flag "--reproducible") set(append "") - set(commands "bash;-c;cpio ${cpio_reproducible_flag} --quiet --create -H newc --file=${CMAKE_CURRENT_BINARY_DIR}/archive.${output_name}.cpio;&&") + set( + commands + "bash;-c;cpio ${cpio_reproducible_flag} --quiet --create -H newc --file=${CMAKE_CURRENT_BINARY_DIR}/archive.${output_name}.cpio;&&" + ) foreach(file IN LISTS input_files) # Try and generate reproducible cpio meta-data as we do this: # - touch -d @0 file sets the modified time to 0 @@ -60,7 +63,7 @@ function(MakeCPIO output_name input_files) endforeach() list(APPEND commands "true") separate_arguments(cmake_c_flags_sep NATIVE_COMMAND "${CMAKE_C_FLAGS}") - if (CMAKE_C_COMPILER_ID STREQUAL "Clang") + if(CMAKE_C_COMPILER_ID STREQUAL "Clang") list(APPEND cmake_c_flags_sep "${CMAKE_C_COMPILE_OPTIONS_TARGET}${CMAKE_C_COMPILER_TARGET}") endif() diff --git a/cmake-tool/simulate_scripts/launch_gdb.py b/cmake-tool/simulate_scripts/launch_gdb.py index 257c1c10..0b9718fc 100755 --- a/cmake-tool/simulate_scripts/launch_gdb.py +++ b/cmake-tool/simulate_scripts/launch_gdb.py @@ -10,6 +10,7 @@ import argparse import signal + def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-b', '--binary', dest='gdb_binary', type=str, @@ -21,10 +22,12 @@ def parse_args(): args = parser.parse_args() return args + if __name__ == "__main__": args = parse_args() - gdb_command_opts = [args.gdb_binary, args.extra_gdb_args, '-ex "target remote :1234"', args.target_executable] + gdb_command_opts = [args.gdb_binary, args.extra_gdb_args, + '-ex "target remote :1234"', args.target_executable] gdb_command = " ".join(gdb_command_opts) print(gdb_command) diff --git a/misc/filter.py b/misc/filter.py index e00d36a2..f0d13a37 100644 --- a/misc/filter.py +++ b/misc/filter.py @@ -37,12 +37,13 @@ def parse_filters(filters_file: str): logging.warning("Failed to open filter file %s: %s", filters_file, exception) return filters + def main(): parser = argparse.ArgumentParser("Filter files.") parser.add_argument('-f', '--filters', type=str, - help='File with glob filters of files') + help='File with glob filters of files') parser.add_argument('files', nargs='*', type=str, - help='List of files to be filtered') + help='List of files to be filtered') args = parser.parse_args() filters = parse_filters(args.filters) @@ -52,5 +53,6 @@ def matches(pattern, fname=fname): if not any(map(matches, filters)): print(fname) + if __name__ == '__main__': sys.exit(main())