From dd89907ce68b7a9fb7401004be1af1edcce48b03 Mon Sep 17 00:00:00 2001 From: Geir Ola Tvinnereim Date: Mon, 4 May 2026 22:42:56 +0200 Subject: [PATCH] Rename linter.sh Update check.yaml --- .github/workflows/check.yaml | 7 ------- README.md | 7 ++++--- formatting.sh | 1 - linter.sh | 1 + 4 files changed, 5 insertions(+), 11 deletions(-) delete mode 100755 formatting.sh create mode 100755 linter.sh diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 38e67bc..5cdf356 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -10,10 +10,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Install clang-format run: sudo apt-get install -y clang-format - - name: Check formatting in /src run: | find ./src \( -iname '*.h' -o -iname '*.cpp' \) -print0 | xargs -0 clang-format --dry-run --Werror @@ -24,25 +22,20 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: install build dependancies run: sudo apt install gcc python3 cmake gcc-arm-none-eabi binutils-arm-none-eabi - - name: microinstall run: | chmod +x microinstall.sh ./microinstall.sh - - name: Add micro-tools to path run: | source ./aliases.sh chmod +x ./aliases.sh ./aliases.sh - - name: Copy src foldet to sdk run: | rsync -a --delete ./src/ ./microbit-v2-sdk/source/ - - name: microbuild python run: | cd microbit-v2-sdk diff --git a/README.md b/README.md index b8f90ab..e0ad613 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ Feed in filepath to microbit-v2-sdk: /Users/geirolatvinnereim/AirBit/microbit-v2 If nrf_sdh_soc_init() cannot be found. You have called build from a wrong folder. Chech microbit-v2-sdk/source and assure that only the src/.cpp files are present. +If there are build errors in the Codal SDK. There are probably some conflicting file names or methods which causes build errors. Delete the build folder produces in /microbit-v2-sdk and rebuild. + ### Debugging In order allow debugging, the project needs to be built by navigating into the microbit-v2-sdk and access debugger inside Visual Studio Code. @@ -79,8 +81,7 @@ python3 build.py We want to utilize a dynamic analysis tool, which can linter codebase, not a static one Using **clang-format** as dynamic cpp-linter. install and usage: -This command line tool can only linter one file at a time, so we need to apply recursiveness +This command line tool can only linter one file at a time, so we need to apply recursiveness at src ```console -brew install clang-format -find /Users/geirolatvinnereim/AirBit/src -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i +./linter.sh ``` \ No newline at end of file diff --git a/formatting.sh b/formatting.sh deleted file mode 100755 index c6d508e..0000000 --- a/formatting.sh +++ /dev/null @@ -1 +0,0 @@ -find /Users/geirolatvinnereim/AirBit/src -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i \ No newline at end of file diff --git a/linter.sh b/linter.sh new file mode 100755 index 0000000..1fb4a6f --- /dev/null +++ b/linter.sh @@ -0,0 +1 @@ +find ./src -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i \ No newline at end of file