How to lint all commits in a PR?
See original GitHub issueI’d like to integrate conventional-changelog-lint
into my CI process. I can enforce a commit convention on “client side” using Husky as per docs, but how would I enforce the convention on CI?
Assuming that a PR is a list of commits that do not exist on master, then getting those commits is simple:
git log master..$(git symbolic-ref --short HEAD)
I am not sure though whats the best way to feed them to conventional-changelog-lint. Here is what I have ended up with for now:
for sha in $(git --no-pager rev-list master..$(git symbolic-ref --short HEAD)); do git cat-file commit $sha | sed '1,/^$/d' | conventional-changelog-lint; done
The problem with the latter is that it doesn’t exit if either of the validation fails.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to lint the message of a pull request merge commit?
I've set up a GitHub Actions workflow that uses commitlint to lint messages for all commits of a pull request, but the problem...
Read more >Squashing Your Pull Requests - Cloud Four
Squash is a Git option to collapse all the incremental commits in your pull request into a single commit. If you use the...
Read more >Pull Requests - ESLint - Pluggable JavaScript Linter
Create a new branch; Make your changes; Rebase onto upstream; Run the tests; Double check your submission; Push your changes; Submit the pull...
Read more >Pull Requests | Electron
There is no limit to the number of commits in a pull request. ... Make sure the linter does not report any issues...
Read more >Submit a Pull Request — tvm 0.11.dev0 documentation
While the lint commands used should be identical to those run in CI, ... python tests/scripts/ci.py lint # Run all lint steps. docker/lint.sh...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
another way to do it.
I tested
with success so far.