Automating Change Logs

I got into the idea of keeping change logs for all my projects after listening to Olivier Lacan on The Changelog. Of course, being the kind of guy who loves to automate everything, I wrote up a couple little things to help me automate the process.

The first thing I cooked up was a set of Vim snippets (specifically for UltiSnips) for creating and updating a change log.

snippet clog "Scaffold a change log" b
# Change Log

## ${1:0.0.1} --- `date +"%F"`

### ${2:Added}

- $0
endsnippet

snippet added "Add to change log" b
## $1 --- `date +"%F"`

### Added

- $0

endsnippet

snippet removed "Remove from change log" b
## $1 --- `date +"%F"`

### Removed

- $0

endsnippet

snippet changed "Change to change log" b
## $1 --- `date +"%F"`

### Changed

- $0

endsnippet

snippet fixed "Fix for change log" b
## $1 --- `date +"%F"`

### Fixed

- $0

endsnippet

snippet deprecated "Deprecation for change log" b
## $1 --- `date +"%F"`

### Deprecated

- $0

endsnippet

After that, I figured it would be a good idea to make it easy to create and open my change logs, so I wrote up this little shell function for that purpose. While it doesn’t do much now, I thought that in case I might want to add some logic to it later — like filling out a starter change log — it might be best to just make it a shell function.

function clog () {
  vim CHANGELOG.md
}

Published on October 10, 2014


Related Posts