Skip to content

Add Board Header Check Action #2519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

will-v-pi
Copy link
Contributor

Add a GitHub action to run check_all_board_headers.sh, but only when either the board headers are updated, or the scripts are updated

Also modify the check_board_header.py script to create multiple exceptions as it goes, and only raise them when necessary, so that you get more errors at once in the output (rather than just getting the first error it finds)

For an example of the errors this will throw, see https://github.com/will-v-pi/pico-sdk/actions/runs/15611738462/job/43974078599

Maintains compatibility with Python < 3.11 for running locally, as ExceptionGroup was added then

@will-v-pi will-v-pi requested a review from lurch June 12, 2025 13:58
@lurch
Copy link
Contributor

lurch commented Jun 12, 2025

Nice! 😀 I'll give this a more detailed look next week.

@lurch
Copy link
Contributor

lurch commented Jun 17, 2025

@will-v-pi Something else I just thought of - might be nice to also use https://github.com/actions/labeler so that any PRs modifying files in the boards include directory automatically get labelled with board settings ? 😀

on:
push:
paths:
- 'src/boards/include/boards/**'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there's probably no reason that this shouldn't be shortened to just 'src/boards/**', given that nothing else lives in that directory?

# Python <3.11 doesn't have ExceptionGroup, so define a simple one
class ExceptionGroup(Exception):
def __init__(self, message, errors):
message += "\n" + "\n".join(e.__str__() for e in errors)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to use str(e) rather than e.__str__() ?

Copy link
Contributor

@lurch lurch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of my questions are important enough to prevent this being merged, especially as the very-similar #2525 has already been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants