Parse the raw configparser data into typed dataclasses. Returns: ParsedPlatformIOConfig with all sections parsed
(self)
| 1239 | return self._parsed_config |
| 1240 | |
| 1241 | def _parse_config(self) -> ParsedPlatformIOConfig: |
| 1242 | """ |
| 1243 | Parse the raw configparser data into typed dataclasses. |
| 1244 | |
| 1245 | Returns: |
| 1246 | ParsedPlatformIOConfig with all sections parsed |
| 1247 | """ |
| 1248 | # Parse [platformio] section |
| 1249 | platformio_section = _parse_platformio_section(self.config) |
| 1250 | |
| 1251 | # Parse [env] section |
| 1252 | global_env_section = _parse_global_env_section(self.config) |
| 1253 | |
| 1254 | # Parse all [env:*] sections |
| 1255 | environments: dict[str, EnvironmentSection] = {} |
| 1256 | for section_name in self.get_env_sections(): |
| 1257 | env_name = section_name[4:] # Remove "env:" prefix |
| 1258 | environments[env_name] = _parse_env_section(self.config, section_name) |
| 1259 | |
| 1260 | # Resolve inheritance (extends) |
| 1261 | resolved_environments: dict[str, EnvironmentSection] = {} |
| 1262 | for env_name, env_section in environments.items(): |
| 1263 | resolved_env = self._resolve_inheritance( |
| 1264 | env_section, environments, global_env_section |
| 1265 | ) |
| 1266 | resolved_environments[env_name] = resolved_env |
| 1267 | |
| 1268 | return ParsedPlatformIOConfig( |
| 1269 | platformio_section=platformio_section, |
| 1270 | global_env_section=global_env_section, |
| 1271 | environments=resolved_environments, |
| 1272 | ) |
| 1273 | |
| 1274 | def _resolve_inheritance( |
| 1275 | self, |
no test coverage detected