conventional-changelog / conventional-changelog/commitlint

[FeatureReq] ability to fix warnings

Open
#584 4 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
18.7k
Forks
970
Avg merge
7h 33m
Merged PRs (30d)
49

Description

_Note: This may exist and just not be documented/be documented somewhere that I didn't look._

1. Provide ability to pass a `--fix` flag to the cli or `config.fix: true | "prompt" | "auto-accept"` in a config file.
2. Provide option to create `config.rules..fix = null | () => {}`

## Expected Behavior

1. Passing the flag or setting the property should cause commitlint to check rules that have the ability to be fixed automatically.
1.1. Can prompt the user to accept the change. (Could possibly add in functionality to always show prompt regardless of warnings or errors)
2. Setting a `fix` property inside of a custom rule sets the method for fixing said warning or error.

## Current Behavior

The current behavior seems to just accept commits with warnings without any fixing capabilities.

## Affected packages
* [x] cli
* [x] core
* [ ] prompt
* [ ] config-angular

## Possible Solution

* alter current commit script to pipe into an additional script that applies a fix and/or prompts for confirmation
* alter core functionality to use a custom parser that generates a commitlint "AST"
## Context

I just made a commit through commitizen that apparently didn't have an empty line before the footer, but commitlint accepted it with a warning.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.