Quick Start
Get started with Karandash in minutes.
1. Initialize Configuration
Create a default configuration file:
karandash init
This creates .karandash/config.yaml in your project root. YAML is the default
format; pass --format kts or --format json for the other two.
2. Configure Rules
Edit .karandash/config.yaml to define validation rules:
rules:
titleFormat:
minLength: 10
pattern: "^(feat|fix|docs|refactor)(\\(.+\\))?!?: .+"
commitMessages:
format: conventional
branchNaming:
pattern: "^(feature|fix|chore)/.+"
The equivalent Kotlin DSL (--format kts):
karandash {
rules {
titleFormat {
minLength = 10
pattern = "^(feat|fix|docs|refactor)(\\(.+\\))?!?: .+"
}
commitMessages {
format = "conventional"
}
branchNaming {
pattern = "^(feature|fix|chore)/.+"
}
}
}
titleFormat also accepts maxLength, requireTicket, and structured
type / scope / subject blocks instead of a raw pattern. See
Rules for the full set of built-in rule IDs.
3. Run Validation
Validate your merge request:
karandash validate
4. CI/CD Integration
GitLab CI
validate:mr:
stage: test
script:
- karandash validate
only:
- merge_requests
GitHub Actions
name: MR Validation
on: [pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: karandash validate