From c7a827a1364bb215aba66d3701d44c080dadf36b Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Fri, 6 May 2022 11:31:24 +0800 Subject: [PATCH] kconfig: update check_kconfigs.py to handle orsource command check_kconfigs.py would only correctly handle "source", but not "rsource", "osource" or "orsource". Fixed any warnings detected after updating the test. --- components/esp_hw_support/Kconfig | 4 ++-- tools/ci/check_kconfigs.py | 8 ++++++-- tools/test_apps/build_system/rsource_test/main/Kconfig | 2 +- .../main/port/esp32/{Kconfig => Kconfig.port} | 0 .../main/port/esp32c2/{Kconfig => Kconfig.port} | 0 .../main/port/esp32c3/{Kconfig => Kconfig.port} | 0 .../main/port/esp32s2/{Kconfig => Kconfig.port} | 0 .../main/port/esp32s3/{Kconfig => Kconfig.port} | 0 8 files changed, 9 insertions(+), 5 deletions(-) rename tools/test_apps/build_system/rsource_test/main/port/esp32/{Kconfig => Kconfig.port} (100%) rename tools/test_apps/build_system/rsource_test/main/port/esp32c2/{Kconfig => Kconfig.port} (100%) rename tools/test_apps/build_system/rsource_test/main/port/esp32c3/{Kconfig => Kconfig.port} (100%) rename tools/test_apps/build_system/rsource_test/main/port/esp32s2/{Kconfig => Kconfig.port} (100%) rename tools/test_apps/build_system/rsource_test/main/port/esp32s3/{Kconfig => Kconfig.port} (100%) diff --git a/components/esp_hw_support/Kconfig b/components/esp_hw_support/Kconfig index 659b599351..4341c4d166 100644 --- a/components/esp_hw_support/Kconfig +++ b/components/esp_hw_support/Kconfig @@ -13,7 +13,7 @@ menu "Hardware Settings" bool # Insert chip-specific MAC config - rsource "./port/$IDF_TARGET/Kconfig.mac" + rsource "./port/$IDF_TARGET/Kconfig.mac" endmenu menu "Sleep Config" @@ -74,8 +74,8 @@ menu "Hardware Settings" menu "RTC Clock Config" orsource "./port/$IDF_TARGET/Kconfig.rtc" - # This is used for configure the RTC clock. config RTC_CLOCK_BBPLL_POWER_ON_WITH_USB + # This is used for configure the RTC clock. bool "Keep BBPLL clock always work" depends on ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG default y diff --git a/tools/ci/check_kconfigs.py b/tools/ci/check_kconfigs.py index 3e9fc089a5..8124bb42ea 100755 --- a/tools/ci/check_kconfigs.py +++ b/tools/ci/check_kconfigs.py @@ -75,7 +75,8 @@ class SourceChecker(BaseChecker): # allow to source only files which will be also checked by the script # Note: The rules are complex and the LineRuleChecker cannot be used def process_line(self, line, line_number): - m = re.search(r'^\s*source(\s*)"([^"]+)"', line) + m = re.search(r'^\s*[ro]{0,2}source(\s*)"([^"]+)"', line) + if m: if len(m.group(1)) == 0: raise InputError(self.path_in_idf, line_number, '"source" has to been followed by space', @@ -140,6 +141,9 @@ class IndentAndNameChecker(BaseChecker): |(help) |(if) |(source) + |(osource) + |(rsource) + |(orsource) ) ''', re.X) @@ -199,7 +203,7 @@ class IndentAndNameChecker(BaseChecker): print('level+', new_item, ': ', self.level_stack, end=' -> ') # "config" and "menuconfig" don't have a closing pair. So if new_item is an item which need to be indented # outside the last "config" or "menuconfig" then we need to find to a parent where it belongs - if new_item in ['config', 'menuconfig', 'menu', 'choice', 'if', 'source']: + if new_item in ['config', 'menuconfig', 'menu', 'choice', 'if', 'source', 'rsource', 'osource', 'orsource']: # item is not belonging to a previous "config" or "menuconfig" so need to indent to parent for i, item in enumerate(reversed(self.level_stack)): if item in ['menu', 'mainmenu', 'choice', 'if']: diff --git a/tools/test_apps/build_system/rsource_test/main/Kconfig b/tools/test_apps/build_system/rsource_test/main/Kconfig index f559b62ce6..de3b8a76c9 100644 --- a/tools/test_apps/build_system/rsource_test/main/Kconfig +++ b/tools/test_apps/build_system/rsource_test/main/Kconfig @@ -1 +1 @@ -rsource "port/$IDF_TARGET/Kconfig" +rsource "port/$IDF_TARGET/Kconfig.port" diff --git a/tools/test_apps/build_system/rsource_test/main/port/esp32/Kconfig b/tools/test_apps/build_system/rsource_test/main/port/esp32/Kconfig.port similarity index 100% rename from tools/test_apps/build_system/rsource_test/main/port/esp32/Kconfig rename to tools/test_apps/build_system/rsource_test/main/port/esp32/Kconfig.port diff --git a/tools/test_apps/build_system/rsource_test/main/port/esp32c2/Kconfig b/tools/test_apps/build_system/rsource_test/main/port/esp32c2/Kconfig.port similarity index 100% rename from tools/test_apps/build_system/rsource_test/main/port/esp32c2/Kconfig rename to tools/test_apps/build_system/rsource_test/main/port/esp32c2/Kconfig.port diff --git a/tools/test_apps/build_system/rsource_test/main/port/esp32c3/Kconfig b/tools/test_apps/build_system/rsource_test/main/port/esp32c3/Kconfig.port similarity index 100% rename from tools/test_apps/build_system/rsource_test/main/port/esp32c3/Kconfig rename to tools/test_apps/build_system/rsource_test/main/port/esp32c3/Kconfig.port diff --git a/tools/test_apps/build_system/rsource_test/main/port/esp32s2/Kconfig b/tools/test_apps/build_system/rsource_test/main/port/esp32s2/Kconfig.port similarity index 100% rename from tools/test_apps/build_system/rsource_test/main/port/esp32s2/Kconfig rename to tools/test_apps/build_system/rsource_test/main/port/esp32s2/Kconfig.port diff --git a/tools/test_apps/build_system/rsource_test/main/port/esp32s3/Kconfig b/tools/test_apps/build_system/rsource_test/main/port/esp32s3/Kconfig.port similarity index 100% rename from tools/test_apps/build_system/rsource_test/main/port/esp32s3/Kconfig rename to tools/test_apps/build_system/rsource_test/main/port/esp32s3/Kconfig.port