-
Notifications
You must be signed in to change notification settings - Fork 648
ci: add black auto-format workflow #2829
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
base: master
Are you sure you want to change the base?
Conversation
note: will add configuration to pyproject.toml if needed in later commit. for now set the line for black in format.yml directly.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
@google-cla recheck |
CHANGELOG updated or no update needed, thanks! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add bug fixes, new features, breaking changes and anything else you think is worthwhile mentioning to the master (unreleased) section of CHANGELOG.md. If no CHANGELOG update is needed add the following to the PR description: [x] No CHANGELOG update needed
CHANGELOG updated or no update needed, thanks! 😄
|
I've updated the workflow to exclude the auto-generated _pb2.py and _pb2.pyi files using the --exclude flag. This prevents the linter from fighting with the machine-generated code. I also pinned the Black version (25.12.0) and set the line length to 120 to match the project's pyproject.toml configuration. |
|
Hi @travtherobber , can you provide some background for this PR? e.g. what does this address that our existing workflows and development requirements don't? |
it was requested in the issue "CI: black create auto-format workflow #2827" |
|
|
||
| jobs: | ||
| format: | ||
| if: github.actor != 'github-actions[bot]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this exclusion here?
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use hashes here like in the other workflow files.
| run: pip install black==25.12.0 | ||
|
|
||
| - name: Run Black | ||
| run: black . --line-length 120 --exclude '.*_pb2.pyi?$' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reuse the CI way to run black here or does this not work? This way we don't have to worry about keeping these in sync.
note: will add configuration to pyproject.toml
if needed in later commit. for now set the line
for black in format.yml directly.
Checklist