Add automatic check for commit message format#36
Add automatic check for commit message format#36shamitha-shashidhara wants to merge 1 commit intoeclipse-openbsw:mainfrom
Conversation
26f2941 to
f384393
Compare
f384393 to
d34853c
Compare
d34853c to
e01a6d6
Compare
.commitlintrc.json
Outdated
| "header-trim": [2, "always"], | ||
| "subject-empty": [1, "never"], | ||
| "subject-full-stop": [2, "never", "."], | ||
| "subject-max-length": [1, "always", 50], |
There was a problem hiding this comment.
50 chars will lead to cryptic subject lines, I strongly vote for 72 chars like in the body.
There was a problem hiding this comment.
I have updated it to 72 chars.
| "body-leading-blank": [2, "always"], | ||
| "body-max-line-length": [1, "always", 72], | ||
| "body-case": [1, "always", "sentence-case"], | ||
| "signed-off-by": [1, "always", "Signed-off-by:"] |
There was a problem hiding this comment.
I don't like this very much. Let's discuss this in the public OpenBSW round.
| "revert", | ||
| "style", | ||
| "test" | ||
| ]], |
There was a problem hiding this comment.
The terms are overlapping, e.g. what to use when refactor the code which improves performance? What if you fix the doc? What would you do when working on process descriptions, is that doc? What would you choose when removing a function? Is that refactor?
Personally, I would not limit this to a certain set of term, but recommend some terms, e.g. start of "Revert" if you revert a comment.
Btw, starting a commit message with lower case looks strange to my eyes.
There was a problem hiding this comment.
The tool is designed to include a type in the commit message header. However, based on your suggestion, users are free to use any custom type; this will only generate a warning, not an error. Similarly, if a commit message does not include a type at all, it will still generate a warning, not an error.
I have also updated the commit message to start with an uppercase letter.
Additionally, we can remove the type restriction from the JSON configuration file to allow contributors more flexibility but the tool will continue to function as designed, issuing a warning if the type is missing, not error
| 4. Push to the Branch (`git push origin newBranchName`) | ||
| 5. Open a Pull Request | ||
|
|
||
| ### Commit Message Format |
There was a problem hiding this comment.
Imho this should be moved to the Sphinx guideline (GitHub pages) and only link from here to the guideline to avoid building up a "second source".
CONTRIBUTION should only summarize what is needed to contribute.
There was a problem hiding this comment.
The detailed commit message guidelines have been moved to the Sphinx documentation (GitHub Pages).
The CONTRIBUTING.md now contains a link to the full guidelines in the documentation.
CONTRIBUTING.md
Outdated
| * **revert**: To undo previous commits | ||
| * **style**: Changes related to formatting or whitespace adjustments | ||
|
|
||
| ##### Subject line |
There was a problem hiding this comment.
Use always "Title Case": https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case
Done for several other headings already in this file.
There was a problem hiding this comment.
Acknowledged
CONTRIBUTING.md
Outdated
|
|
||
| ##### Subject line | ||
|
|
||
| Use the subject field to provide a breif description of the change: |
There was a problem hiding this comment.
Acknowledged
- Add GitHub Actions workflow to lint commit messages on push and pull request events. - Create custom commitlint configuration file (.commitlintrc.json) to enforce commit message standards. - Document commit message format in CONTRIBUTING.md Signed-off-by: Shamitha Shashidhara <shamitha.shashidhara@accenture.com>
e01a6d6 to
8cf7d79
Compare
|
Would it make sense to use gitlint like in S-CORE? |
|
|
||
| .. code-block:: text | ||
|
|
||
| <type>: <subject line> |
There was a problem hiding this comment.
We probably don't want any additional metadata like in the subject line. So this particular check would need to be reversed.
Uh oh!
There was an error while loading. Please reload this page.