Skip to content
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

Why not both? #42

Closed
nikolasleblanc opened this issue Jan 25, 2019 · 8 comments
Closed

Why not both? #42

nikolasleblanc opened this issue Jan 25, 2019 · 8 comments

Comments

@nikolasleblanc
Copy link

This plugin seems to only do title, commit message, or (title or commit message), but not (title and commit message). Can it?

@zeke
Copy link
Owner

zeke commented Jan 25, 2019

👋 Thanks for reporting. You're right about the current behavior. Here's what we have now:

default behavior: validate title or at least one commit is semantic
titleOnly: true: Always validate the PR title, and ignore the commits
commitsOnly: true: Always validate all commits, and ignore the PR title

For what reason would you want to validate both the title and all commits? I'm not against it, but wondering about your use case.

@CecileRobertMichon
Copy link

+1 on this.

Our use case is the following: GitHub doesn't let you choose a default squash commit message. Squashing a pull request with one commit would use that commit’s message, but squashing a pull request with more than one commit will use the pull request’s title for the commit message. We want to make sure that every single external contributor PR in our repo gets merged with a valid squash commit message so checking both would be beneficial for us.

Ideally we would be able to check the squash commit message only (so PR title for multiple commits, commit for single commit).

@zeke
Copy link
Owner

zeke commented Feb 28, 2019

@CecileRobertMichon would only allowing "squash merging" on the repo work for your case?

screen shot 2019-02-28 at 8 38 46 am

@CecileRobertMichon
Copy link

@zeke not exactly. We already only allow squash merging. The issue is that I can't control how many commits are in a pull request and GitHub is inconsistent when squash merging commits. If there is a single commit, the commit message comes from the commit. If there are multiple commits, the commit message comes from the PR title. So checking only the commits or only the title is not sufficient since either may be used at squash time.

@zeke
Copy link
Owner

zeke commented Feb 28, 2019

Got it. There's an open issue about squashing single-commit PRs: #17

I am pretty busy right now, but would happily accept and ship a PR that addresses this.

@clakech
Copy link
Contributor

clakech commented Apr 24, 2019

We would like to have both to have consistency between PR titles and all commits

Here is a first implementation / proposal #42

@nikolasleblanc
Copy link
Author

#46 @clakech I think you meant this PR of yours :)

@zeke
Copy link
Owner

zeke commented Apr 25, 2019

Resolved by #46 -- this should be live within a few minutes.

@zeke zeke closed this as completed Apr 25, 2019
corserp added a commit to corserp/semantic-pull-requests that referenced this issue Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants