mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
build: add commit message tooling
Add a repository-local tool to lint, format, and safely reword commit messages. Preserve markdown lists, quotes, code blocks, and trailers while enforcing subject and body width limits. Expose linting, formatting, and rewording through Make targets and document the supported workflows. Run the linter in CI for pull request and push commit ranges so malformed messages are caught before merging.
This commit is contained in:
parent
41bc5f85df
commit
eb63b0b4fe
4 changed files with 1058 additions and 0 deletions
31
.github/workflows/main.yml
vendored
31
.github/workflows/main.yml
vendored
|
|
@ -24,6 +24,37 @@ env:
|
|||
LITD_ITEST_BRANCH: master
|
||||
|
||||
jobs:
|
||||
########################
|
||||
# commit message lint
|
||||
########################
|
||||
commit-message:
|
||||
name: Commit Message
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: git checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Lint commit messages
|
||||
env:
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
BEFORE_SHA: ${{ github.event.before }}
|
||||
GITHUB_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
if [ "$EVENT_NAME" = "pull_request" ]; then
|
||||
range="$BASE_SHA..$HEAD_SHA"
|
||||
elif [ "$EVENT_NAME" = "push" ] &&
|
||||
[ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
|
||||
range="$BEFORE_SHA..$GITHUB_SHA"
|
||||
else
|
||||
range="$(git rev-parse HEAD^ 2>/dev/null)..HEAD"
|
||||
fi
|
||||
|
||||
make commitmsg-lint range="$range"
|
||||
|
||||
########################
|
||||
# RPC compile and check
|
||||
########################
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue