commitlint-scope

Git commit conventional scope linter.
Table of contents
Purpose
Lint changed files against configured scope. Similar to CODEOWNERS.
Useful if your dev-flow requires strict scoped file changes control over CI process.
Quick start
Install
https://github.com/thumbrise/commitlint-scope/releases
Run
commitlint-scope --from main --to feature
Configuration file
Init
Generate .commitlint-scope.yml file.
commitlint-scope init
Overview
#$schema: https://github.com/thumbrise/commitlint-scope/blob/main/docs/schema/config.json
# Scope parsing customization. Not required, if you follow common conventional header. In example: 'type!(scope): subject'
#scopeRegex: ^[a-z]+(?:\((?P<scope>[^)]+)\))?!?:\s
# Patterns map: each key is a scope name, value is a list of glob patterns that match files belonging to that scope.
patterns:
"auth": [ "services/auth/**" ]
"migrations": [ "database/migrations/*.sql" ]
"frontend": [ "**/assets/**", "**/frontend/**" ]
"docs": [ "**/*.md" ]
Zero Configuration
Without configuration file - scopes are treated as file-glob matches, relative to repository root.
feat(auth): Some subject
Linter will compare changed files against glob pattern auth/**
CI
TODO: Add high-DX examples
JSON schema
https://github.com/thumbrise/commitlint-scope/blob/main/docs/schema/config.json
License
Apache 2.0