Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat add parser opts #821

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: parser options
  • Loading branch information
Mateus Mamede Lage committed Sep 1, 2021
commit e6284963331c34bc9197e21d46509c53a99118b1
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,25 @@ If you do not want to have any tag prefix you can use the `-t` flag and provide

> Note: simply -t or --tag-prefix without any value will fallback to the default 'v'

### Parser Options

If you need to include custom parser options to read your commits, you can use the `--parser-opts` to indicate the path to a .js file that exports the options.

```sh
standard-version --parser-options ./parser-opts.js
mmamedel marked this conversation as resolved.
Show resolved Hide resolved
```

This can be useful in cases like Azure DevOps that uses custom merge pull request titles. The `parser-opts.js` could look like this:

```js
module.exports = {
mergePattern: /^Merged PR (\d+): (\w*)(?:\(([\w\$\.\-\* ]*)\))?\: (.*)$/,
mergeCorrespondence: ['id', 'type', 'scope', 'subject']
}
```

For more informantion on what parser options are available, reference to [documentation](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser).

### CLI Help

```sh
Expand Down