Skip to content

Check for WIP before the header length check #11

Closed

Description

@javier-godoy

Problem

validateCommitMessage checks the header length (src/isValidCommitMesage.ts:59) before anything else. main.ts only calls isWIP when the message is valid. So a WIP commit whose header is 72 characters or longer comes out as invalid, not wip.

A caller that reports the outcome itself (enforce: false) then gets it wrong twice:

  • wip-commits says "No Work-in-Progress (WIP) commits", because no result has level: 'wip'.
  • semver-alignment says "The semantic versioning level is unknown": one commit message couldn't be parsed, so the version isn't verified.

Only the length error comes through. It hides the fact that the branch has an unsquashed WIP commit, and it blocks the version check, even though a WIP commit contributes no semver level anyway (getSemverLevel returns 0 for WIP).

Example

FlowingCode/CommonsDemo#167, commit f111ab2:

WIP: trim the following node when the delimiter follows the license header

That header is 74 characters. The run reported:

{"header":"WIP: trim the following node when the delimiter follows the license header","level":"invalid","reason":"The length of the header line (including type and scope) must be less than 72 characters"}

The wip-commits check passed, and semver-alignment was skipped as unknown.

Image

Expected

Check for WIP before the length check. A WIP commit has to be squashed or reworded before merging anyway, so its header length doesn't matter. It should be classified as wip, which makes wip-commits fail and leaves the semver level to the other commits.

Activity

  1. self-assigned this
    on Sep 23, 2026
  2. moved this from Inbox (needs triage) to In Progress in Flowing Code Addonson Sep 23, 2026
  3. javier-godoy commented on Sep 23, 2026

    @javier-godoy
    Author

    Fixed.
    Image

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions