Skip to content

kmbisset89/change-log-conventonial-commit

Repository files navigation

Change Log Plugin

This plugin is used to create a Markdown file based on the git history of the project. This plugin in particular is parsing out commits that follow the conventional commit pattern. The pattern of how the change log is laid out is by a JSON.

Currently Supported Types

  • feat
  • fix
  • change

Setup

Importing

Gradle link : https://plugins.gradle.org/plugin/io.github.kmbisset89.changelog.plugin

The above link has the most up to date instructions on how incorporate this plugin with your project build gradle.

Configuring

There are a few customization options for this plugin.

Version Regex

The way that the plugin groups the conventional commits is by a tag regex. Currently based off of semantic versioning, the default is matching [Int].[Int].[Int]. Examples of this pattern are 1.0.0, 0.1.5097, and 23.87.1989. If you use release candidates, and have not release code these will be grouped as unreleased changes. Example of which is the tag 1.0.1 exist but a feature is pushed creating 1.0.2-rc.1. This would be untracked until 1.0.2 tag had been finalized.

The above paragraph states what is default. You can however pass in a regex for the rules for the generator to follow.

Formatting JSON

The goal of utilizing this pattern was to create a way for other to implement the ChangeLog they wanted generated without too much headache. The list below shows the current keywords.

  • title
      This keyword allows for a custom document title.
    
  • introduction
      Any static text that should be included before the autogenerated portion.
    
  • eachVersion
      Nested JSON with how to handle the components of each version.
    
    • tag
      Use this key to put the version into the CHANGELOG.
      
    • feat - New features
       title - Section Title
       each - for each conventional commit
          - description as defined by conventional commit
          - body as defined by conventional commit
          - footer as defined by conventional commit
      
    • fix - For bugfixes
       title - Section Title
       each - for each conventional commit
      - description as defined by conventional commit
      - body as defined by conventional commit
      - footer as defined by conventional commit
      
    • changes - Changes in existing features
       title - Section Title
        each - for each conventional commit
        - description as defined by conventional commit
        - body as defined by conventional commit
        - footer as defined by conventional commit
      

Default Formatting

{
   "title":{
      "attr":"H1",
      "text":"Change Log",
      "breakAfter":"horizontalRule"
   },
   "introduction":{
      "attr":"bold",
      "breakAfter":"newLine"
   },
   "eachVersion":{
      "tag":{
         "attr":"H2",
         "breakAfter":"newLine"
      },
      "feat":{
         "title":{
            "attr":"H3",
            "text":"Features Added",
            "breakAfter":"newLine"
         },
         "each":{
            "description":{
               "attr":"bold",
               "breakAfter":"newLine"
            },
            "body":{
               "attr":"bullet",
               "breakAfter":"newLine"
            },
            "footer":{
               "attr":"para",
               "breakAfter":"newLine"
            }
         }
      },
      "fix":{
         "title":{
            "attr":"H3",
            "text":"Bugs Addressed",
            "breakAfter":"newLine"
         },
         "each":{
            "description":{
               "attr":"bold",
               "breakAfter":"newLine"
            },
            "body":{
               "attr":"bullet",
               "breakAfter":"newLine"
            },
            "footer":{
               "attr":"para",
               "breakAfter":"newLine"
            }
         }
      },
      "change":{
         "title":{
            "attr":"H3",
            "text":"Existing Feature Modifications",
            "breakAfter":"newLine"
         },
         "each":{
            "description":{
               "attr":"bold",
               "breakAfter":"newLine"
            },
            "body":{
               "attr":"bullet",
               "breakAfter":"newLine"
            },
            "footer":{
               "attr":"para",
               "breakAfter":"newLine"
            }
         }
      }
   }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages