-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
chore: add lint-pr action #9341
Conversation
cc @aaronc @alexanderbez @marbar3778 Any initial thoughts? Is this something we should discuss on one of our community calls first? Also, I can remove the commented out configuration options but I left them here initially for visibility. |
I'm a bit lost on what types and scope actually mean here? Is there an example of how the PR would look with this? |
The type is what type of change is being made (i.e. feat, fix, refactor, chore, etc.). The scope is to further specify the topic of the change (e.g. what package the changes touch). Here is an example from Conventional Commits:
The general idea is to improve how we track changes and to further encourage atomic pull requests. Here is a snippet from the Conventional Commits specification:
|
oh okay, Thanks for the explanation. I think it makes sense to be this strict. |
I'm certainly in favor of something like this, but two initial questions:
|
From the action-semantic-pull-request description, "This is a Github Action that ensures that your PR title matches the Conventional Commits spec." This action is not concerned with individual commits, it only checks the PR title, which will become the commit when all the commits have been squashed and merged.
The Go convention proposes to prefix the first line of the commit with the package name. Conventional Commits proposes to use the type of change and a scope (which could be the package name). Conventional Commits is more specific and extends beyond the Go community, but you are right, these two conventions are not aligned and we should decide on one or the other. One of the advantages of using Conventional Commits is that it works with tools like semantic-release. At Regen Network, we have been discussing ways to improve upon the release process and this convention for commits was one suggestion. Also, another example of this convention in use is the dependabot pull requests. |
The idea is good. I have one concern: Will this work with our auto-squashing / automerge functionality? |
Yes as long as the check passes. We are already using it in regen-ledger |
I just want to clarify one goal I have related to this is the idea that we have QA checklists for PR reviewers that are related to the type of PR. So a docs PR would have a different QA checklist than a feature PR. Now, conventional commits is not the only way to achieve this. But, it is a somewhat widely used standard and focuses the PR on one and only one type of change (docs, feature, fix, etc.) which is generally good. We could alternatively use Regarding PR scope, which could be indicated with the golang convention (ex. So, basically I support these conventional commit prefix tags ( |
I've update the configuration to use the default configuration. See configuration for additional configuration options. |
Also, updated pull request summary and added link to default types for reference. |
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
Just an internal note: it would be good to set this up too on regen-ledger
* add lint-pr config * use default config Co-authored-by: ryanchrypto <12519942+ryanchrypto@users.noreply.github.com> Co-authored-by: Aaron Craelius <aaron@regen.network>
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.
pr lint
Description
This pull request adds the configuration for a "Lint PR" action (see action-semantic-pull-request) that ensures each pull request title follows the Conventional Commits specification.
This update will require future pull request titles to be prefixed with one of the default types before the pull request can be merged. There is no requirement for scope at this time.
ref #9268
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
) - n/agodoc
comments. - n/aUnreleased
section inCHANGELOG.md
- n/aFiles changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes