Skip to content

Commit 435c117

Browse files
authored
refactor check tools install
1 parent e3e7f62 commit 435c117

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

platform.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,17 @@ def configure_default_packages(self, variables, targets):
109109
if tl_flag:
110110
# Install tool is not needed anymore
111111
del self.packages["tl-install"]
112-
# Enable check tools only when "check_tool" is enabled
113-
for p in self.packages:
114-
if p in ("tool-cppcheck", "tool-clangtidy", "tool-pvs-studio"):
115-
self.packages[p]["optional"] = False if str(variables.get("check_tool")).strip("['']") in p else True
112+
CHECK_PACKAGES = [
113+
"tool-cppcheck",
114+
"tool-clangtidy",
115+
"tool-pvs-studio"
116+
]
117+
# Install check tool listed in pio entry "check_tool"
118+
if variables.get("check_tool") is not None:
119+
for package in CHECK_PACKAGES:
120+
for check_tool in variables.get("check_tool", ""):
121+
if check_tool in package:
122+
self.packages[package]["optional"] = False
116123

117124
if "arduino" in frameworks:
118125
self.packages["framework-arduinoespressif32"]["optional"] = False

0 commit comments

Comments
 (0)