Validate the platformio.ini structure and return any issues. Returns: List of validation issues (empty if valid)
(self)
| 1173 | return replacement_made |
| 1174 | |
| 1175 | def validate_structure(self) -> list[str]: |
| 1176 | """ |
| 1177 | Validate the platformio.ini structure and return any issues. |
| 1178 | |
| 1179 | Returns: |
| 1180 | List of validation issues (empty if valid) |
| 1181 | """ |
| 1182 | issues: list[str] = [] |
| 1183 | |
| 1184 | # Check for at least one environment section |
| 1185 | env_sections = self.get_env_sections() |
| 1186 | if not env_sections: |
| 1187 | issues.append( |
| 1188 | "No environment sections found (sections starting with 'env:')" |
| 1189 | ) |
| 1190 | |
| 1191 | # Validate each environment section |
| 1192 | for section in env_sections: |
| 1193 | # Check for required fields |
| 1194 | if not self.has_option(section, "platform"): |
| 1195 | issues.append(f"Section '{section}' missing required 'platform' option") |
| 1196 | |
| 1197 | # Check for board specification |
| 1198 | if not self.has_option(section, "board"): |
| 1199 | issues.append(f"Section '{section}' missing 'board' option") |
| 1200 | |
| 1201 | return issues |
| 1202 | |
| 1203 | def to_dict(self) -> dict[str, dict[str, str]]: |
| 1204 | """ |