Skip to content

Commit

Permalink
Add gitlint to Makefile target
Browse files Browse the repository at this point in the history
And make pre-commit-config.yaml to use it. It wasn't working properly
before.

Let's detect those stupid linting error before sending the PR.
  • Loading branch information
chmouel authored and vdemeester committed Dec 12, 2024
1 parent cbcad5c commit 013e81e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ repos:
- id: check-vcs-permalinks
- id: detect-private-key
exclude: ".*_test.go"
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
Expand Down Expand Up @@ -49,4 +45,10 @@ repos:
entry: "shellcheck"
language: system
types: [shell]
- id: gitlint
name: "Gitlint"
entry: "make"
language: system
types: [text]
args: ["gitlint"]
# TODO: add a lint-sh when we have the errors fix
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ generated: update-golden fumpt ## generate all files that needs to be generated
.PHONY: download-hugo
download-hugo:
./hack/download-hugo.sh $(HUGO_VERSION) $(TMPDIR)/hugo

.PHONY: gitlint
gitlint: ## Run gitlint
@gitlint --commit "`git log --format=format:%H --no-merges -1`" --ignore "Merge branch"


.PHONY: clean
clean: ## clean build artifacts
Expand Down

0 comments on commit 013e81e

Please sign in to comment.