conform icon indicating copy to clipboard operation
conform copied to clipboard

Feature Request: Option to print the Commit message it self in enforce output

Open janderssonse opened this issue 2 years ago • 1 comments

Currently, a run with enforce gives the PASS or FAIL output. However, to see the commit header itself that was tested one has to run git log or alike. It would simplify usage if the git commit message header that was tested against was show in the enforce out put.

This would make even more sense when running a multiple commits check, https://github.com/siderolabs/conform/commit/9023e3a114677975577153025e69dcdeebf72034 as it is now, the output can be a bit confusing without a header of the message tested against seperating them.

Example of current output: with enforce --base-branch=main, from a feature branch with multiple commits:

A commit message between every section would be really helpful here, to see the difference between the 3 commits validated:



commit        Header Length                PASS          Header is 17 characters

commit        Imperative Mood              PASS          Commit begins with imperative verb

commit        Header Case                  PASS          Header case is valid

commit        Header Last Character        PASS          Header last character is valid

commit        DCO                          PASS          Developer Certificate of Origin was found

commit        GPG                          PASS          GPG signature found

commit        Conventional Commit          PASS          Commit message is a valid conventional commit

commit        Header Length                PASS          Header is 27 characters

commit        Imperative Mood              FAILED        First word of commit must be an imperative verb: "added" is invalid

commit        Header Case                  PASS          Header case is valid

commit        Header Last Character        PASS          Header last character is valid

commit        DCO                          FAILED        Commit does not have a DCO

commit        GPG                          PASS          GPG signature found

commit        Conventional Commit          FAILED        Invalid type "dore": allowed types are [chore docs perf refactor style test release feat fix feat fix feat fix]
commit        Header Length                PASS          Header is 26 characters

commit        Imperative Mood              PASS          Commit begins with imperative verb

commit        Header Case                  PASS          Header case is valid

commit        Header Last Character        PASS          Header last character is valid

commit        DCO                          PASS          Developer Certificate of Origin was found

commit        GPG                          PASS          GPG signature found

commit        Conventional Commit          PASS          Commit message is a valid conventional commit

Suggest example of current output: with enforce --base-branch=main, from a feature branch with multiple commits:


COMMIT HEADER: feat: add a commit

commit        Header Length                PASS          Header is 17 characters

commit        Imperative Mood              PASS          Commit begins with imperative verb

commit        Header Case                  PASS          Header case is valid

commit        Header Last Character        PASS          Header last character is valid

commit        DCO                          PASS          Developer Certificate of Origin was found

commit        GPG                          PASS          GPG signature found

commit        Conventional Commit          PASS          Commit message is a valid conventional commit

COMMIT HEADER: feat: added a commit

commit        Header Length                PASS          Header is 27 characters

commit        Imperative Mood              FAILED        First word of commit must be an imperative verb: "added" is invalid

and so on

janderssonse avatar Feb 22 '23 08:02 janderssonse

This should be quite easy to implement, but requires adding a new concept like ReportGroup/CheckGroup. Currently the report data is a flat list of Check objects.

I might look into it.

terlar avatar Nov 08 '24 09:11 terlar