diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-07-24 17:26:10 (GMT) |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-07-24 17:26:10 (GMT) |
| commit | e4d9636e8258c25efbd79d26a8167b17fe7252c8 (patch) | |
| tree | ececf05c0b434659fd9f7e551b864ee4f8ca7e07 | |
| parent | d666c5004f27da2c72abd6f94881143bc157a10d (diff) | |
| parent | a25ce5d8fc994004ac847f8ae814e6a57329030a (diff) | |
Merge branch 'develop' into new_touch_handler
| -rw-r--r-- | CMakeLists.txt | 4 | ||||
| -rw-r--r-- | hooks/README.md | 5 | ||||
| -rwxr-xr-x | hooks/pre-commit | 25 | ||||
| -rw-r--r-- | src/displayapp/screens/FlashLight.cpp | 2 |
4 files changed, 31 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d02c10..b442fc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,10 +21,6 @@ if (NOT NRF5_SDK_PATH) message(FATAL_ERROR "The path to the NRF52 SDK must be specified on the command line (add -DNRF5_SDK_PATH=<path>") endif () -if(NOT USE_JLINK AND NOT USE_GDB_CLIENT AND NOT USE_OPENOCD) - set(USE_JLINK true) -endif() - if(USE_JLINK) if (NOT NRFJPROG) message(FATAL_ERROR "the path to the tool nrfjprog must be specified on the command line (add -DNRFJPROG=<path>") diff --git a/hooks/README.md b/hooks/README.md new file mode 100644 index 0000000..de8fc67 --- /dev/null +++ b/hooks/README.md @@ -0,0 +1,5 @@ +# Git hooks + +This directory contains Git hooks that simplify contributing to this repository. + +You can install them by copying the files into `.git/hooks` in the repository folder or by running `git config --local core.hooksPath hooks` diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..5e10aa1 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,25 @@ +#!/bin/bash +if clang-format --version | grep -q 'version 11\.'; then + CLANG_FORMAT_EXECUTABLE="clang-format" +else + CLANG_FORMAT_EXECUTABLE="clang-format-11" +fi + +if ! command -v $CLANG_FORMAT_EXECUTABLE &> /dev/null +then + echo $CLANG_FORMAT_EXECUTABLE does not exist, make sure to install it + exit 1 +fi + +for FILE in $(git diff --cached --name-only) +do + if [[ "$FILE" =~ src/[A-Za-z0-9\ \-]+*\.(c|h|cpp|cc)$ ]]; then + echo Autoformatting $FILE with $CLANG_FORMAT_EXECUTABLE + $CLANG_FORMAT_EXECUTABLE -style=file -i -- $FILE + git add -- $FILE + elif [[ "$FILE" =~ src/(components|displayapp|drivers|heartratetask|logging|systemtask)/.*\.(c|h|cpp|cc)$ ]]; then + echo Autoformatting $FILE with $CLANG_FORMAT_EXECUTABLE + $CLANG_FORMAT_EXECUTABLE -style=file -i -- $FILE + git add -- $FILE + fi +done diff --git a/src/displayapp/screens/FlashLight.cpp b/src/displayapp/screens/FlashLight.cpp index 7db2c6c..63b2345 100644 --- a/src/displayapp/screens/FlashLight.cpp +++ b/src/displayapp/screens/FlashLight.cpp @@ -70,5 +70,5 @@ bool FlashLight::Refresh() { } bool FlashLight::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - return true; + return false; } |
