Skip to content

Commit

Permalink
Enable gitlint in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Mar 24, 2024
1 parent 2cb88a0 commit 7ab46e5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changelog/662.process.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Tweak ci-lint workflow

- prevent issues with dependabot PRs
- limit towncrier check to pull_request event
to fix an issue with failing workflow for merge commits (push event)
- enable gitlint
8 changes: 8 additions & 0 deletions .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
with:
python-version: '3.x'
# Needed for Towncrier fork to work with 3.12 and above
- name: Install gitlint
run: |
python -m pip install gitlint
- name: Install setuptools
run: |
python -m pip install setuptools
Expand All @@ -57,6 +60,11 @@ jobs:
if: |
github.event_name == 'pull_request' &&
github.actor != 'dependabot[bot]'
- name: Lint git commits
run: |
make lint-git
# Always run this step so that all linting errors can be seen at once, but skip for dependabot
if: always() && github.actor != 'dependabot[bot]'
- name: Lint Change Log fragments
run: |
make lint-changelog
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,15 @@ fmt:
@goimports -w -local github.com/oasisprotocol/nexus .

# Lint code, commits and documentation.
lint-targets := lint-go lint-go-mod-tidy lint-changelog
lint-targets := lint-go lint-go-mod-tidy lint-changelog lint-git

lint-go: codegen-go
@$(ECHO) "$(CYAN)*** Running Go linters...$(OFF)"
@env -u GOPATH golangci-lint run

lint-git:
@$(CHECK_GITLINT)

lint-changelog:
@$(CHECK_CHANGELOG_FRAGMENTS)

Expand Down

0 comments on commit 7ab46e5

Please sign in to comment.