Skip to content

Latest commit

 

History

History
90 lines (75 loc) · 2.12 KB

File metadata and controls

90 lines (75 loc) · 2.12 KB

Resource for https://www.youtube.com/watch?v=JlfCRlFHmd8

Conventional installation instructions for Ubuntu

Copied from DevInsideYou/install-nodejs:

wget -q https://script.install.devinsideyou.com/nodejs
sudo chmod +x nodejs && ./nodejs
sudo npm install -g @commitlint/cli
sudo npm install -g @commitlint/config-conventional

Feel free to use a target local to your project.

echo "module.exports = { extends: ['@commitlint/config-conventional'] }" > ~/.commitlintrc.js
sudo npm install -g commitizen
sudo npm install -g cz-conventional-changelog

Feel free to use a target local to your project.

echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

cz-emoji (optional)

Note: this requires changes to commitlint.

sudo npm install -g cz-emoji

Replaces cz-conventional-changelog.

echo '{ "path": "cz-emoji" }' > ~/.czrc

Optionally use unicode instead of gitmoji by editing the ~/.czrc:

{
  "path": "cz-emoji",
  "config": {
    "cz-emoji": {
      "symbol": true
    }
  }
}

Automatically lint your commit messages

cd /path/to/my/repo

echo 'echo "$(cat $1)" | commitlint' > .git/hooks/commit-msg
chmod +x .git/hooks/commit-msg
sudo npm install -g standard-version

Version bumps for Scala SBT projects

Contents of my-project/.versionrc.json:

{
  "bumpFiles": [
    {
      "filename": "version.sbt",
      "updater": "standard-version-updater.js"
    }
  ]
}

Contents of my-project/standard-version-updater.js:

module.exports.readVersion = contents =>
  contents.match(/"(?<version>.*)"/).groups.version

module.exports.writeVersion = (_, version) =>
  `ThisBuild / version := "${version}"\n`