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

Commitlint: Accept standard git revert commits #240

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2022 Northern.tech AS
Copyright 2023 Northern.tech AS

All content in this project is licensed under the Apache License v2, unless
indicated otherwise.
Expand Down
3 changes: 1 addition & 2 deletions LIC_FILES_CHKSUM.sha256
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

1033348db7606a7e61b6484f293847cf8d7a35766efebb97e304d4bd5d7f3f6b LICENSE
52b2497ce07650b825015e80ca7a5d40c360c04c530234ca6d950b0f98bca23a LICENSE
#
# BSD-3-Clause
2eb550be6801c1ea434feba53bf6d12e7c71c90253e0a9de4a4f46cf88b56477 vendor/github.com/pmezard/go-difflib/LICENSE
Expand Down
10 changes: 8 additions & 2 deletions commitlint/commitlint
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function advance() {
tok_type = next_tok_type
next_tok = _tok
next_tok_type = _tok_type
debugf("Current token: %s", tok)
debugf("Next token: %s", next_tok)
debugf("Current token(%s): %s", tok_type, tok)
debugf("Next token(%s): %s", next_tok_type, next_tok)
}

function _advance() {
Expand Down Expand Up @@ -315,6 +315,12 @@ function is_footer(token) {

function parse() {

# In the case of Reverts, the commit is already in the tree, so it need not be
# conforming to our specification.
if (match(next_tok, "Revert")){
return
}

parse_header()

# expect empty line before the body
Expand Down
8 changes: 7 additions & 1 deletion commitlint/testcommitlint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/bash
# Copyright 2022 Northern.tech AS
# Copyright 2023 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -451,5 +451,11 @@ Changelog: none
Signed-off-by: Kristian Amlie <[email protected]>"


assert "true" \
"Accept standard git-revert commits" \
"Revert \"build(docker-client): Add support for building the cpp-client

This reverts commit 6a80e86e265a1d659bac6e3e67b899ba387f829c.\""


exit 0