From 761aae6f892edc3d447e4478e4d20c3d124a66a1 Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Thu, 13 Jun 2024 05:15:38 -0500 Subject: [PATCH] [CI] Allow clang-tidy to see IDF components (#6903) * Allow clang-tidy to see IDF components * Remove camera, add tflite-micro --- .github/workflows/ci.yml | 7 +++++++ esphome/idf_component.yml | 9 +++++++++ script/clang-tidy | 6 ++++-- 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 esphome/idf_component.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c10e5dac7..df7a9178e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -387,6 +387,13 @@ jobs: echo "::add-matcher::.github/workflows/matchers/gcc.json" echo "::add-matcher::.github/workflows/matchers/clang-tidy.json" + - name: Run 'pio run --list-targets -e esp32-idf-tidy' + if: matrix.name == 'Run script/clang-tidy for ESP32 IDF' + run: | + . venv/bin/activate + mkdir -p .temp + pio run --list-targets -e esp32-idf-tidy + - name: Run clang-tidy run: | . venv/bin/activate diff --git a/esphome/idf_component.yml b/esphome/idf_component.yml new file mode 100644 index 0000000000..ba1a6312e2 --- /dev/null +++ b/esphome/idf_component.yml @@ -0,0 +1,9 @@ +dependencies: + esp-tflite-micro: + git: https://github.com/espressif/esp-tflite-micro.git + mdns: + git: https://github.com/espressif/esp-protocols.git + version: mdns-v1.2.5 + path: components/mdns + rules: + - if: "idf_version >=5.0" diff --git a/script/clang-tidy b/script/clang-tidy index 84b02306d5..bd919825fd 100755 --- a/script/clang-tidy +++ b/script/clang-tidy @@ -101,8 +101,10 @@ def clang_options(idedata): # add library include directories using -isystem to suppress their errors for directory in sorted(set(idedata["includes"]["build"])): # skip our own directories, we add those later - if not directory.startswith(f"{root_path}/") or directory.startswith( - f"{root_path}/.pio/" + if ( + not directory.startswith(f"{root_path}/") + or directory.startswith(f"{root_path}/.pio/") + or directory.startswith(f"{root_path}/managed_components/") ): cmd.extend(["-isystem", directory])