Skip to content

config: Added checkstyle's commit message CI test#388

Merged
romani merged 1 commit intocheckstyle:masterfrom
MiriyalaJayanth-19:cij1
Apr 30, 2026
Merged

config: Added checkstyle's commit message CI test#388
romani merged 1 commit intocheckstyle:masterfrom
MiriyalaJayanth-19:cij1

Conversation

@MiriyalaJayanth-19
Copy link
Copy Markdown
Contributor

@MiriyalaJayanth-19 MiriyalaJayanth-19 commented Apr 15, 2026

Addded a ci job that matches the commit message format to that of CheckStyle's.

Commit message must match any one of the following patterns:
- ^Issue #\d+: .*$
- ^Pull #\d+: .*$
- ^(minor|config|infra|doc|spelling|dependency): .*$
- Length : max 200 characters

@romani
Copy link
Copy Markdown
Member

romani commented Apr 15, 2026

Can we reuse https://github.com/marketplace/actions/gitlint-action
Or similar already existing action ?

@MiriyalaJayanth-19
Copy link
Copy Markdown
Contributor Author

I think its better we use gitlint-action and modify it to checkstyle's rules, made the changes.

@romani
Copy link
Copy Markdown
Member

romani commented Apr 18, 2026

I still see bunch of bash scripting instead of action reusage

@MiriyalaJayanth-19 MiriyalaJayanth-19 force-pushed the cij1 branch 5 times, most recently from 1d6f156 to 0b88bfb Compare April 19, 2026 11:45
@MiriyalaJayanth-19
Copy link
Copy Markdown
Contributor Author

MiriyalaJayanth-19 commented Apr 19, 2026

@romani made the changes , added .gitlint file in project root repo with checkstyle commit rules and linter.yml in /.github/workflow

@romani
Copy link
Copy Markdown
Member

romani commented Apr 19, 2026

CI is red

@romani
Copy link
Copy Markdown
Member

romani commented Apr 19, 2026

add new lines to all files you added

@MiriyalaJayanth-19 MiriyalaJayanth-19 force-pushed the cij1 branch 6 times, most recently from 1e5cf02 to 5f6364d Compare April 20, 2026 05:18
@MiriyalaJayanth-19
Copy link
Copy Markdown
Contributor Author

The CI now uses gitlint with a configuration aligned to Checkstyle’s commit message rules. It validates:

Required patterns (Issue #, Pull #, or allowed prefixes)
Max length (≤ 200 characters)
No trailing punctuation or whitespace
I also scoped the validation to only the commits from the current PR by keeping base.sha..HEAD , so it doesn’t affect already merged commits.

I added new line at end of both the files , i think github is not showing it.

Thanks for guiding me patiently . It means a lot .

@romani
Copy link
Copy Markdown
Member

romani commented Apr 20, 2026

Code is good, please add new commit with any update in code and bad commit message, I want to see CI failure.

@MiriyalaJayanth-19
Copy link
Copy Markdown
Contributor Author

@romani should i add a section in linter.yml file that outputs clear error message upon ci failure like in checkstyle.

@romani
Copy link
Copy Markdown
Member

romani commented Apr 21, 2026

Commit b616b06b98:
1: T7 Title does not match regex (^(Issue #\d+: .*|Pull #\d+: .*|(minor|config|infra|doc|spelling|dependency): .*)$): "added checkstyles commit-message ci test"
Error: Process completed with exit code 1.

https://github.com/checkstyle/patch-filters/actions/runs/24703915425/job/72252838475?pr=388

all good.

please remove text commit, lets merge this PR.

@MiriyalaJayanth-19
Copy link
Copy Markdown
Contributor Author

@romani ping

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot.

Let's see how this works in long run.

@romani romani merged commit 6178119 into checkstyle:master Apr 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants