From e54449bf84c15e68ae3a601659b3bcc35a3c52a0 Mon Sep 17 00:00:00 2001 From: rbaron Date: Sat, 10 Apr 2021 18:19:37 +0200 Subject: [PATCH] Adds `make lint` and `make lint-fix` --- code/b-parasite/Makefile | 10 +++++++++- code/b-parasite/src/prst/.clang-format | 1 + code/b-parasite/src/prst/ble.h | 3 +-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 code/b-parasite/src/prst/.clang-format diff --git a/code/b-parasite/Makefile b/code/b-parasite/Makefile index c0be3b9..5643a60 100644 --- a/code/b-parasite/Makefile +++ b/code/b-parasite/Makefile @@ -311,4 +311,12 @@ sdk_config: .PHONY: flash_loop flash_loop: - while [ 1 ]; do make flash && break; done \ No newline at end of file + while [ 1 ]; do make flash && break; done + +.PHONY: lint +lint: + find src -iname *.h -o -iname *.c | xargs clang-format -n -Werror + +.PHONY: fix +lint-fix: + find src -iname *.h -o -iname *.c | xargs clang-format -i \ No newline at end of file diff --git a/code/b-parasite/src/prst/.clang-format b/code/b-parasite/src/prst/.clang-format new file mode 100644 index 0000000..2593ef5 --- /dev/null +++ b/code/b-parasite/src/prst/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: Google \ No newline at end of file diff --git a/code/b-parasite/src/prst/ble.h b/code/b-parasite/src/prst/ble.h index df7bdb9..bfe8460 100644 --- a/code/b-parasite/src/prst/ble.h +++ b/code/b-parasite/src/prst/ble.h @@ -13,7 +13,6 @@ void prst_adv_stop(); void prst_ble_update_adv_data(uint16_t batt_millivolts, uint16_t temp_millicelcius, uint16_t humidity, - uint16_t soil_moisture, - uint8_t run_counter); + uint16_t soil_moisture, uint8_t run_counter); #endif // _PRST_BLE_H_ \ No newline at end of file