# Commit Lint configuration

Lints Pull Request commits with CommitLint. CommitLint checks if your commit messages meet the conventional commit format.

In general the pattern mostly looks like this:

type(scope?): subject  #scope is optional; multiple scopes are supported (current delimiter options: "/", "\" and ",")

Real world examples can look like this:

chore: run tests on travis ci

fix(server): send cors headers

feat(blog): add comment section

Common types according to commitlint-config-conventional (based on the the Angular convention) can be:

  • build
  • ci
  • chore
  • docs
  • feat
  • fix
  • perf
  • refactor
  • revert
  • style
  • test

# .sun-ci.yml config

@commitlint/cli picks up configuration from ./commitlint.config.js so you need create it before linting.

stages:
- Test

jobs:
- name: CommitLint
  stage: Test
  image: sunci/commitlint:latest
  before_script:
    - echo "module.exports = {extends:['@commitlint/config-conventional']}" > commitlint.config.js
  script:
    - export COMMIT_MESSAGE=$(git log -1 --pretty=format:"%s")
    - echo "$COMMIT_MESSAGE" | commitlint