Run checks on a Mercurial Repository

Usage no npm install needed!

<script type="module">
  import hgChecks from 'https://cdn.skypack.dev/hg-checks';



A module to run checks on a mercurial repository within the tool chain before deploying a module. It is configured by config file or command line switches and the following checks are implemented:

  • tagFormat - checks whether the latest tag follows the semantic versioning convention.
  • changesSinceLastTag - checks whether there have been committed or uncommitted changes since the last tag.
  • uncommittedChanges - checks whether there are currently uncommitted changes.

These checks are switchable but are all run by default.


-h, --help                              output usage information
--no-uncommitted-changes                Do not run uncommitted changes check
--no-changes-since-last-tag             Do not run changes since latest tag check
--no-tag-format                         Do not run tag format semantic version check
-f,--custom-tag-format [custom-format]  Use a custom regexp for tag
-c,--config [config-file]               Include a configuration file
-o,--output [file]                      Output configuration file
-L,--list                               List Checks
-v, --verbose                           Verbose


npm install hg-checks

Configuration file (also command line switches - see hg-checks --help)

  "verbose": "true",
  "uncommittedChanges": "false",
  "tagFormat": "true",
  "customTagFormat": "\\S+",
  "changesSinceLastTag": "false"

Output Configuration file - creates a file with current configuration (including command line switches)

hg-checks -o hgchecks.json -v --no-tag-format

Example use in npm package.json

"scripts": {
    "hgchecks": "hg-checks -c <config-file>",
    "publish": "node run hgchecks && node run deploy"


MIT, No Attribution Required, Copyright 2016 Les Green