Skip to content

Latest commit

 

History

History
108 lines (78 loc) · 4.11 KB

README.md

File metadata and controls

108 lines (78 loc) · 4.11 KB

Plugin logo

Conventional Commit

Looking for the latest plugin binaries? Get them here as .zip
Supported IDE versions: 192.* to 193.* (both inclusive)


The aim of this plugin is to provide completion for conventional commits, also named semantic commits, inside the VCS Commit dialog.
The plugin must provide:

  • standard completion - based on context
  • template completion - initiated intentionally
  • extensibility - which means allowing attaching providers for the various parts of the commit:
    type, scope and subject

Writing quality commit messages is important to keep an understandable and searchable history of your project. Conventional commits are a perfect example of that.
However it can happen choosing the correct type or scope (if any) isn't that immediate. We might have forgotten about when a specific type should be used, or which are the available scopes, or we simply need a way to quickly complete the subject.

The plugin helps with the above, while also respecting the aforementioned requirements, so that each user is able to customize the experience based on its preferences.

Completion modes

The plugin offers two completion modes.

  • Context based

    The commit message can be written like you have done until now, but by explicitly invoking completion you'll be offered the correct items based on the scope. Certain commodities, such as auto-completing the scope parenthesis or the : separator, are there too.

    Standard completion
  • Template based

    By firstly invoking the type completion and confirming an item, a template will be generated in place and you'll be guided through each token (scope and _subject). You can also go back (with shift + tab) and change your pick.

    Arbitrary characters insertion is also allowed inside each template's range marker.

    Template completion

Custom default tokens

Default tokens can be totally customized, and shared with your team, by creating and populating a JSON file named

cc_defaults.json

Custom defaults

You're allowed to provide custom types and scopes, and the JSON file must respect a certain scheme, which is shown here as an example.

{
  "customType": {
    "description":"My custom type description"
  },
  "anotherCustomType": { },
  "yetAnotherCustomType": {
    "description":"This is my description",
    "scopes": {
      "first": {
        "description":"My first description"
      },
      "second": {
        "description":"My second description"
      }
    }
  }
}

Providers

In a fresh installation you'll only be offered the most common tokens (e.g. fix, feat, build, etc.), but the plugin exposes an API to enhance completion items, per each token. Type, scope and subject each have a specific entry point, and the implementation is called Provider. Each Provider is listed in a table, based on its context.

Providers

You're allowed to re-order Providers per your necessities, knowing that possible duplicates are going to be automatically filtered by the core engine.

More on this later on...


Author