From 72979fb6c2c8047ae17decfee3e8bbcae69ee26a Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 16 Sep 2025 21:23:47 +0800 Subject: [PATCH] fix(ci): update ast-grep rules to include esp_hal components --- tools/ci/sg_rules/no_kconfig_in_hal_component.yml | 4 ++++ tools/ci/sg_rules/no_std_assert_in_hal_component.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tools/ci/sg_rules/no_kconfig_in_hal_component.yml b/tools/ci/sg_rules/no_kconfig_in_hal_component.yml index 53d17e1e4b..02697e76c2 100644 --- a/tools/ci/sg_rules/no_kconfig_in_hal_component.yml +++ b/tools/ci/sg_rules/no_kconfig_in_hal_component.yml @@ -6,10 +6,12 @@ note: hal component should be able to deliver without 3rd party config system language: C files: - "components/hal/**/*" + - "components/esp_hal*/**/*" ignores: # porting layer and test apps are allowed to use Kconfig macros - "components/hal/platform_port/**/*" - "components/hal/test_apps/**/*" + - "components/esp_hal*/test_apps/**/*" # the following files should be refactored to remove Kconfig macros - "components/hal/adc_oneshot_hal.c" - "components/hal/cache_hal.c" @@ -43,10 +45,12 @@ note: hal component should be able to deliver without 3rd party config system language: C files: - "components/hal/**/*" + - "components/esp_hal*/**/*" ignores: # porting layer and test apps are allowed to include sdkconfig.h - "components/hal/platform_port/**/*" - "components/hal/test_apps/**/*" + - "components/esp_hal*/test_apps/**/*" # the following files should be refactored to remove sdkconfig.h - "components/hal/adc_oneshot_hal.c" - "components/hal/cache_hal.c" diff --git a/tools/ci/sg_rules/no_std_assert_in_hal_component.yml b/tools/ci/sg_rules/no_std_assert_in_hal_component.yml index 11b5632b99..73b8f964a2 100644 --- a/tools/ci/sg_rules/no_std_assert_in_hal_component.yml +++ b/tools/ci/sg_rules/no_std_assert_in_hal_component.yml @@ -6,8 +6,10 @@ note: The standard assert function depends on esp_libc(G1) component, but hal is language: C files: - "components/hal/**/*" + - "components/esp_hal*/**/*" ignores: - "components/hal/test_apps/**/*" + - "components/esp_hal*/test_apps/**/*" rule: kind: expression_statement pattern: assert($$$ARGS); @@ -22,8 +24,10 @@ note: Please use hal/assert.h to replace assert.h language: C files: - "components/hal/**/*" + - "components/esp_hal*/**/*" ignores: - "components/hal/test_apps/**/*" + - "components/esp_hal*/test_apps/**/*" rule: kind: preproc_include has: