1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 11:22:24 +01:00

[clang] clang tidy support with zephyr (#8352)

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
tomaszduda23
2025-05-13 01:36:34 +02:00
committed by GitHub
parent f4eb75e4e0
commit 7c0546c9f0
8 changed files with 237 additions and 45 deletions

View File

@@ -5,6 +5,7 @@ import re
import subprocess
import colorama
import helpers_zephyr
root_path = os.path.abspath(os.path.normpath(os.path.join(__file__, "..", "..")))
basepath = os.path.join(root_path, "esphome")
@@ -147,10 +148,14 @@ def load_idedata(environment):
# ensure temp directory exists before running pio, as it writes sdkconfig to it
Path(temp_folder).mkdir(exist_ok=True)
stdout = subprocess.check_output(["pio", "run", "-t", "idedata", "-e", environment])
match = re.search(r'{\s*".*}', stdout.decode("utf-8"))
data = json.loads(match.group())
if "nrf" in environment:
data = helpers_zephyr.load_idedata(environment, temp_folder, platformio_ini)
else:
stdout = subprocess.check_output(
["pio", "run", "-t", "idedata", "-e", environment]
)
match = re.search(r'{\s*".*}', stdout.decode("utf-8"))
data = json.loads(match.group())
temp_idedata.write_text(json.dumps(data, indent=2) + "\n")
return data