Check if an example should be skipped for a specific board. Parses the @filter/@end-filter block from the .ino file and determines if compilation should be skipped based on board properties. Args: board: Board configuration example: Example name Returns: Tu
(board: Board, example: str)
| 191 | |
| 192 | |
| 193 | def should_skip_example_for_board(board: Board, example: str) -> tuple[bool, str]: |
| 194 | """Check if an example should be skipped for a specific board. |
| 195 | |
| 196 | Parses the @filter/@end-filter block from the .ino file and determines |
| 197 | if compilation should be skipped based on board properties. |
| 198 | |
| 199 | Args: |
| 200 | board: Board configuration |
| 201 | example: Example name |
| 202 | |
| 203 | Returns: |
| 204 | Tuple of (skip: bool, reason: str) |
| 205 | - skip=True means don't compile for this board |
| 206 | - reason explains why (or empty string if not skipped) |
| 207 | """ |
| 208 | try: |
| 209 | ino_path = get_example_ino_path(example) |
| 210 | except FileNotFoundError: |
| 211 | # If we can't find the .ino file, don't skip |
| 212 | return False, "" |
| 213 | |
| 214 | sketch_filter = parse_filter_from_sketch(ino_path) |
| 215 | return should_skip_sketch(board, sketch_filter) |
| 216 | |
| 217 | |
| 218 | def get_filtered_examples( |