Skip to content

Commit cb767a8

Browse files
Fix GitHub workflow for Git Hooks and add Git Hooks to this repo
1 parent 75dac30 commit cb767a8

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

.github/workflows/style.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,18 @@ jobs:
1010
name: Check Coding Style
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416

1517
# Check EditorConfig
1618
- name: Install eclint
1719
run: sudo npm install -g eclint
1820
- name: Check EditorConfig style
1921
run: eclint check $(git ls-files)
22+
23+
# Check Commit Messages
24+
- name: Install pre-commit
25+
run: pip install pre-commit
26+
- name: Check commits
27+
run: pre-commit run --hook-stage manual

.gitlint

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[general]
2+
ignore = body-is-missing
3+
contrib = contrib-title-conventional-commits

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
default_install_hook_types:
2+
- pre-commit
3+
- pre-push
4+
- commit-msg
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.0.1
9+
hooks:
10+
- name: Check, that no large files have been committed
11+
id: check-added-large-files
12+
13+
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
14+
rev: '2.7.1'
15+
hooks:
16+
- name: Check EditorConfig
17+
id: editorconfig-checker
18+
alias: ec
19+
20+
- repo: https://github.com/jorisroovers/gitlint
21+
rev: "v0.19.1"
22+
hooks:
23+
- name: Lint commit messages
24+
id: gitlint
25+
- id: gitlint-ci
26+
args: ['--commits', 'origin/main..HEAD']

0 commit comments

Comments
 (0)