Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Add config to ignore certain branches #31

Open
TomSeldon opened this issue Dec 16, 2016 · 0 comments
Open

Add config to ignore certain branches #31

TomSeldon opened this issue Dec 16, 2016 · 0 comments

Comments

@TomSeldon
Copy link
Contributor

We've found that when this tool is introduced to an existing project, there can be invalid commits that already exist on long running, shared branches.

For example if develop already contains many commits not yet in master, and then the commit message checker is added, when a pull request is created to merge develop into master, it can fail if any of the commits are invalid.

That may sound correct, but to fix the issue you'd have to rewrite history of the branch, which is an extremely undesirable thing to do on a shared branch. Far better to just let the invalid commits through and know that the standard will be enforced on all future commits.

This boils down to being able to ignore specific long running, shared branches. For most projects this would be master and develop, but would have to be configurable on a per-project basis (long running feature branches, etc.).

Whilst I don't like the idea of configurability for this tool (it should be consistent across projects), the goal is to enforce commit message standards and not developer workflow. With that in mind I think it would be appropriate to add this kind of feature.

I expect that this feature would require having .commit-message-checker.yml in the project root, with contents like:

ignore_pull_requests_from_branches:
    - master
    - develop
    - some-shared-branch

Note the name "ignore_pull_requests_from_branches" is quite specific. I didn't want to use ignore_branches or similar as that typically means the target branch (in services like Travis/Appveyor) and so could lead to confusion.

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

No branches or pull requests

1 participant