MCPcopy Create free account
hub / github.com/FastLED/FastLED / validate

Method validate

ci/compiler/argument_parser.py:63–108  ·  view source on GitHub ↗

Validate configuration and return list of error messages.

(self)

Source from the content-addressed store, hash-verified

61 backend: BuildBackend = BuildBackend.FBUILD
62
63 def validate(self) -> list[str]:
64 """Validate configuration and return list of error messages."""
65 errors: list[str] = []
66
67 # Validate merged-bin requirements
68 if self.merged_bin:
69 if len(self.examples) != 1:
70 errors.append(
71 f"--merged-bin requires exactly one sketch, got {len(self.examples)}"
72 )
73 if len(self.boards) != 1:
74 errors.append(
75 f"--merged-bin requires exactly one board, got {len(self.boards)}"
76 )
77 if self.boards and not self.boards[0].board_name.startswith("esp"):
78 errors.append(
79 f"--merged-bin only supports ESP32/ESP8266, got {self.boards[0].board_name}"
80 )
81
82 # Validate output path requirements
83 if self.output_path:
84 if len(self.examples) != 1:
85 errors.append(
86 f"-o/--out requires exactly one sketch, got {len(self.examples)}"
87 )
88 if len(self.boards) != 1:
89 errors.append(
90 f"-o/--out requires exactly one board, got {len(self.boards)}"
91 )
92
93 # Validate WASM requirements
94 if self.workflow == WorkflowType.WASM:
95 if len(self.examples) != 1:
96 errors.append(
97 f"WASM compilation requires exactly one example, got {len(self.examples)}"
98 )
99 if len(self.boards) != 1 or self.boards[0].board_name != "wasm":
100 errors.append("WASM compilation requires board='wasm'")
101
102 # Validate max_failures
103 if self.max_failures is not None and self.max_failures <= 0:
104 errors.append(
105 f"--max-failures must be a positive integer, got {self.max_failures}"
106 )
107
108 return errors
109
110
111class CompilationArgumentParser:

Callers 1

parseMethod · 0.45

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected