From cd2b6fc649737d419737715378f52e7507fc07e2 Mon Sep 17 00:00:00 2001 From: Ruslan Kokoev Date: Fri, 29 May 2026 03:10:29 +0300 Subject: [PATCH 1/2] feat: Add patterns description comment to initial config --- cmd/commands/init.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/commands/init.go b/cmd/commands/init.go index 6b18710..261e001 100644 --- a/cmd/commands/init.go +++ b/cmd/commands/init.go @@ -20,6 +20,8 @@ const InitConfigData = `#$schema: https://github.com/thumbrise/commitlint-scope/ # Scope parsing customization. Not required, if you follow common conventional header. In example: 'type!(scope): subject' #scopeRegex: ^[a-z]+(?:\((?P[^)]+)\))?!?:\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" ] From 6061ec42b06201f447e476314bc58e05654d572c Mon Sep 17 00:00:00 2001 From: Ruslan Kokoev Date: Fri, 29 May 2026 03:25:20 +0300 Subject: [PATCH 2/2] docs: Update README.md --- README.md | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/README.md b/README.md index 8457b29..b074460 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,89 @@ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](/LICENSE) [![Coverage Status](https://coveralls.io/repos/github/thumbrise/commitlint-scope/badge.svg?branch=main)](https://coveralls.io/github/thumbrise/commitlint-scope?branch=main) [![Go Report Card](https://goreportcard.com/badge/github.com/thumbrise/commitlint-scope)](https://goreportcard.com/report/github.com/thumbrise/commitlint-scope) + +Git commit conventional scope linter. + +## Table of contents + + +* [commitlint-scope](#commitlint-scope) + * [Table of contents](#table-of-contents) + * [Purpose](#purpose) + * [Quick start](#quick-start) + * [Install](#install) + * [Run](#run) + * [Configuration file](#configuration-file) + * [Zero Configuration](#zero-configuration) + * [CI](#ci) + * [JSON schema](#json-schema) + * [License](#license) + + +## 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 + +```shell +commitlint-scope --from main --to feature +``` + +## Configuration file + +**Init** + +Generate .commitlint-scope.yml file. + +```shell +commitlint-scope init +``` + +**Overview** + +```yaml +#$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[^)]+)\))?!?:\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. + +```text +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