-
-
Notifications
You must be signed in to change notification settings - Fork 36
Add GitHub push action enforcing Prettier style #451
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
Conversation
It looks like the action's email address will need to match one that's acceptable to the CLA bot. @aphillips @macchiati Is there any such bot email address yet that could be used? |
I'll add it as an exception. Ok to fix tomorrow? |
Tomorrow's completely fine; this is fixing a long-running annoyance. Right now the email address is empty in the generated commits, so please tell me which address to use once you've got it set up? For example, |
I don't know what a good email would be. But i wonder if Anyway i added it to the allow list so you should be able to pass this |
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.
LGTM can update the id later
I set the action to use |
|
seemed to make it not work… i just added |
🎉 |
Phew, I think it's now sorted? Thank you @srl295 for your help here! |
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.
💯 for persistence
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.
This PR adds a GitHub Action that runs Prettier after every commit that touches a
.md
file and pushes any changes to the current branch with astyle: Apply Prettier
commit message.
Please don't auto-commit to main
like this. It will generate needless diffs, making browsing the history and blaming files more difficult. Instead, let's set up a CI check on all PRs and require it to pass before merging. All changes to the spec should go through PRs anyways.
This would have the same effect on PRs as a CI check, because it's run on all pushes on all forks. The benefit of doing it this way is that the style corrections are automatic rather than blocking. For example, if a PR review suggestion commit introduces some trailing whitespace to a spec PR, this would immediately fix that, rather than blocking the PR with a failing check which would need manual action. The only way this would add a |
that's what CLDR and Unicodetools do. if you forget, your PR just doesn't pass until it's fixed. Auto committing to a PR seems reasonable. |
Oh, do you mean that there will be automatic commits in the PR's branch, but since we merge by squashing, they will never make it to |
@eemeli i would recommend having the action only apply to PRs and not to main. |
We chose in CLDR and ICU to have the equivalent to Prittier be run as a
test, and fail if the format would change. That way what the author has in
the PR is exactly what is merged in. It does place the onus on the author
to run the prettier before committing to a PR, but has a cleaner record in
github.
…On Wed, Aug 16, 2023 at 3:02 PM Stanisław Małolepszy < ***@***.***> wrote:
This would have the same effect on PRs as a CI check, because it's run on
all pushes on all forks. The benefit of doing it this way is that the style
corrections are automatic rather than blocking.
Oh, do you mean that there *will* be automatic commits in the PR's
branch, but since we merge by squashing, they will never make it to main?
—
Reply to this email directly, view it on GitHub
<#451 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACJLEMFYMDFTTWNMCBKIGOTXVU7ORANCNFSM6AAAAAA3QMSJZM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes. Going forward, to submit a PR you'll need a branch here or a fork of this repo that'll include the
The problem is that if/as we do occasionally commit directly to Allowing commits also on |
Co-authored-by: Steven R. Loomis <[email protected]>
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.
As agreed in today's meeting, let's try this as-is and see how many auto-commits actually make it to main
.
The styles we use to write markdown vary, and the result is occasionally a bit messy.
Prettier defines some pretty decent defaults, and using them allows us to care less about the style we use. This PR adds a GitHub Action that runs Prettier after every commit that touches a
.md
file and pushes any changes to the current branch with astyle: Apply Prettier
commit message.The first commit here fixes the one place where the styling appeared to cause an issue in
spec/syntax.md
; the second commit has been automatically generated by the action.