Skip to content

Line-wrapped Signed-off-by trailers are not matched #315

Description

@tykeal

Observation

lib/dco.js matches explicit sign-offs with a per-line regex:

  • lib/dco.js:119-125 defines getSignoffs(...) and const regex = /^Signed-off-by: (.*) <(.*)>\s*$/gim;.
  • Because the regex is anchored with ^ and $ in multiline mode, and the name/email capture is expected on that same line, a trailer split over two physical lines is not matched as an explicit sign-off.

A real example of this formatting exists in servo/servo commit 12e6135ef7. The commit message contains:

Signed-off-by: Budiman Arbenta
<50914575+BudiArb@users.noreply.github.com>

The same commit also contains other one-line trailers, but the wrapped trailer above is not a shape getSignoffs currently recognizes.

Practical effect

Some tools, mail-based workflows, and editors wrap long trailer lines. In that case, a genuinely signed-off commit can be reported as missing its sign-off.

This is a false FAILURE: the contributor can be blocked despite complying. It is not a false pass.

Caution for a fix

The fix is not simply to allow arbitrary newlines. Relaxing the regex too broadly could match prose in a commit body that merely mentions a sign-off. Any change should preserve the trailer-only intent so it does not introduce a false pass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions