summaryrefslogtreecommitdiff
path: root/.woodpecker/lint.yml
blob: e3c45d6a0cc62c5cbbb469d362bbac47beea4ec4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
when:
  event: pull_request
steps:
  - name: validate-commit-message
    image: alpine:latest
    commands:
      - apk add --no-cache grep git
      - |
        echo "Validating commit message format..."
        COMMIT_MSG=$(git log -1 --pretty=%B)
        if ! echo "$COMMIT_MSG" | grep -qE "^(feat|fix|docs|style|refactor|perf|test|chore|ci)(\([a-z0-9-]+\))?(!)?: .+"; then
          echo "Error: Commit message does not follow conventional commits format."
          echo "Expected format: type(scope): description"
          echo "Example: feat(auth): add user authentication"
          exit 1
        fi
    when:
      event:
        - pull_request

  - name: hadolint
    image: hadolint/hadolint:latest-debian
    commands:
      - hadolint Dockerfile
    when:
      event:
        - pull_request

  - name: rust-fmt
    image: rust:1.88
    commands:
      - cargo fmt --all -- --check
    when:
      event:
        - pull_request

  - name: rust-clippy
    image: rust:1.88
    commands:
      - cargo clippy --all-targets --all-features -- -D warnings
    when:
      event:
        - pull_request