commitlint
No long description provided.
Installation
dagger install github.com/JaykeOps/daggerverse/commitlint@v0.2.0Entrypoint
Return Type
Commitlint Example
dagger -m github.com/JaykeOps/daggerverse/commitlint@93ee6cd12e3d00701453f9fa4b6d1e8934cc63b8 call \
func (m *MyModule) Example() *dagger.Commitlint {
return dag.
Commitlint()
}@function
def example() -> dagger.Commitlint:
return (
dag.commitlint()
)@func()
example(): Commitlint {
return dag
.commitlint()
}Types
Commitlint 🔗
This module validates commit messages with
lintMessage() 🔗
Lint a single commit message.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| message | String ! | - | Commit message to validate. |
| config | File | - | Commitlint configuration file path. Defaults to commitlint.config.mjs in the module root. |
Example
dagger -m github.com/JaykeOps/daggerverse/commitlint@93ee6cd12e3d00701453f9fa4b6d1e8934cc63b8 call \
lint-message --message stringfunc (m *MyModule) Example(ctx context.Context, message string) string {
return dag.
Commitlint().
LintMessage(ctx, message)
}@function
async def example(message: str) -> str:
return await (
dag.commitlint()
.lint_message(message)
)@func()
async example(message: string): Promise<string> {
return dag
.commitlint()
.lintMessage(message)
}lintRange() 🔗
Lint commit messages in a Git revision range.
Use this in pull-request CI when every commit that will land on the target branch must follow Conventional Commits.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository directory to lint. |
| from | String ! | - | Start revision for commitlint's --from option. |
| to | String ! | - | End revision for commitlint's --to option. |
| config | File | - | Commitlint configuration file path. Defaults to commitlint.config.mjs in the module root. |
Example
dagger -m github.com/JaykeOps/daggerverse/commitlint@93ee6cd12e3d00701453f9fa4b6d1e8934cc63b8 call \
lint-range --source DIR_PATH --from string --to stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, from string, to string) string {
return dag.
Commitlint().
LintRange(ctx, source, from, to)
}@function
async def example(source: dagger.Directory, from_: str, to: str) -> str:
return await (
dag.commitlint()
.lint_range(source, from_, to)
)@func()
async example(source: Directory, from: string, to: string): Promise<string> {
return dag
.commitlint()
.lintRange(source, from, to)
}lintDiff() 🔗
Lint commit messages that are unique to the current branch.
This compares HEAD against a base revision, computes the merge-base,
and lints every commit from that merge-base to HEAD. By default, the
base is origin/master.
Use this when you want to validate all new commits on a feature branch before merging, while ignoring commits that already exist on the target branch. This is useful for projects that keep semantic commit history and use automated release/changelog generation.
Common use cases:
- Local validation before opening a pull request.
- Pull-request CI where every commit in the branch must follow Conventional Commits.
- Rebase-merge workflows where individual commits will land on the target branch.
Example: lint commits on the current branch that are not on origin/master:
git fetch origin master
dagger -m github.com/JaykeOps/daggerverse/commitlint@<version> call lint-diff \
--source=. \
--base=origin/master
Example with origin/main:
git fetch origin main
dagger -m github.com/JaykeOps/daggerverse/commitlint@<version> call lint-diff \
--source=. \
--base=origin/main
In GitHub Actions, use fetch-depth: 0 so the merge-base can be resolved:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint branch commits
run: >
dagger -m github.com/JaykeOps/daggerverse/commitlint@<version> call lint-diff
--source=.
--base=origin/master
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Git repository directory to lint. It must include enough Git history to resolve the base revision. |
| base | String ! | "origin/master" | Base branch or revision to compare against. Defaults to `origin/master`. |
| config | File | - | Commitlint configuration file path. Defaults to `commitlint.config.mjs` in the module root. |
Example
dagger -m github.com/JaykeOps/daggerverse/commitlint@93ee6cd12e3d00701453f9fa4b6d1e8934cc63b8 call \
lint-diff --source DIR_PATH --base stringfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, base string) string {
return dag.
Commitlint().
LintDiff(ctx, source, base)
}@function
async def example(source: dagger.Directory, base: str) -> str:
return await (
dag.commitlint()
.lint_diff(source, base)
)@func()
async example(source: Directory, base: string): Promise<string> {
return dag
.commitlint()
.lintDiff(source, base)
}