conventional-changelog / conventional-changelog/commitlint

cli: Provide an init command

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

Description

As seen in #47 setup currently easily allows for errors in documentation and frustration for users. Add an `commitlint init [--extends]` command. It should

* [ ] create a new `commitlint.config.js` file if needed, prefer `package.json` if available
* [ ] ensure `@commitlint/cli`
* install/update `@commitlint/cli` as needed
* [ ] add configs provided via `--extends` to `module.exports.extends`
* default to `@commitlint/config-conventional`
* support multiple `--extends`
* check if values are available if npm ids
* install/update `@commitlint/config-*` as needed
* disable via `--no-config`
* [ ] ensure `husky`
* ensure presence of commitmsg run-script
* disable via `--no-husky`
* [ ] add `@commitlint/travis-cli` to `.travis.yml` if file is found and not in scripts
* install/update `@commitlint/travis-cli` as needed
* disable via `--no-travis`

* ~~optional: respect .editorconfig?~~ overkill

Contributor guide

Open the contributing guide

Research direction

Start by reading issue #47 and the existing CLI entry points, then trace how package.json, commitlint.config.js, and .travis.yml are handled. The work is complete when commitlint init supports the listed config, dependency, Husky, Travis, and disabling options, with tests covering the requested combinations.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
ci-cd, cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.