<commit_before># changelog-rb

For project that uses feature branches and merge requests, it is common that the `CHANGELOG.md` will have conflicts. In order to prevent that, it is better to manage changelog items in a separate folder (`./changelog`) and generate the `CHANGELOG.md` during release.

This gem defines a bunch of commands to simplify the management of changelog items in `./changelog`.

The `CHANGELOG.md` generated will follow the amazing [keepachangelog](http://keepachangelog.com/en/1.0.0/) format.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'changelog-rb'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install changelog-rb

## Folder Structure

```
- changelog
  - 0.1.1
    - fixed_something.yml
    - tag.yml
  - 0.1.0
    - added_something.yml
    - changed_something.yml
    - tag.yml
  - unreleased
    - added_something.yml
    - changed_something.yml
    - removed_something.yml
```

All the pending/unreleased changelog items should be in the `unreleased` folder. Once you release a new version, the corresoding changelog items in `unreleased` should be moved over to `[RELEASE VERSION]` folder.

The `tag.yml` in release folder is for recording the date of release.

## Usage

There are a bunch of commands helping you to manage the changelog items. They are base on the awesome library [thor](https://github.com/erikhuda/thor) so you can always check all the command options by running `changelog help [COMMAND]`.

### `setup`

Set up the basic folder structure.

```
$ changelog setup
```

### `add`

Add a changelog item.

| `-t` | Type of changes (one of the following `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`) | If not specified, it will try to derive it from the first word of the title |
| `-u` | Author | If not specified, it will be $USER |
| `-g` | From git commit comment | *Magic*. Get the git commit comment as changelog title. Please try to use it with `gitmoji`. |

```
$ changelog add "Changed something"<commit_msg>README: Typo fix [ci skip]<commit_after># changelog-rb

For project that uses feature branches and merge requests, it is common that the `CHANGELOG.md` will have conflicts. In order to prevent that, it is better to manage changelog items in a separate folder (`./changelog`) and generate the `CHANGELOG.md` during release.

This gem defines a bunch of commands to simplify the management of changelog items in `./changelog`.

The `CHANGELOG.md` generated will follow the amazing [keepachangelog](http://keepachangelog.com/en/1.0.0/) format.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'changelog-rb'
```

And then execute:

    $ bundle install

Or install it yourself as:

    $ gem install changelog-rb

## Folder Structure

```
- changelog
  - 0.1.1
    - fixed_something.yml
    - tag.yml
  - 0.1.0
    - added_something.yml
    - changed_something.yml
    - tag.yml
  - unreleased
    - added_something.yml
    - changed_something.yml
    - removed_something.yml
```

All the pending/unreleased changelog items should be in the `unreleased` folder. Once you release a new version, the corresponding changelog items in `unreleased` should be moved over to `[RELEASE VERSION]` folder.

The `tag.yml` in release folder is for recording the date of release.

## Usage

There are a bunch of commands helping you to manage the changelog items. They are base on the awesome library [thor](https://github.com/erikhuda/thor) so you can always check all the command options by running `changelog help [COMMAND]`.

### `setup`

Set up the basic folder structure.

```
$ changelog setup
```

### `add`

Add a changelog item.

| `-t` | Type of changes (one of the following `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`) | If not specified, it will try to derive it from the first word of the title |
| `-u` | Author | If not specified, it will be $USER |
| `-g` | From git commit comment | *Magic*. Get the git commit comment as changelog title. Please try to use it with `gitmoji`. |

```
$ changelog add "Changed something"
{'fraction_non_alphanumeric': 0.09871452825612419, 'fraction_numerical': 0.00436575309240844, 'mean_word_length': 3.7023945267958953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2419482', 'n_tokens_mistral': 1283, 'n_tokens_neox': 1230, 'n_words': 529}