Nothing Major
Ensures that you've marked your breaking change commits.
Usage
Right now, this assumes that you're using the Angular commit message format. In the future, this may be configurable.
$ nothing-major -b 'build script' -t 'test script'
This will do the following:
- Check and see if you've already noted that the current commit has breaking changes.
- Creates a temporary directory.
- Checks out your code into a
git-worktree
in the temporary directory. - Runs the supplied build script.
- Checks out the test files from the previous commit.
- Runs the supplied test script, exiting cleanly if it passes.
- Cleans up the temporary directory and the git worktree.
For an NPM project, this script may look like:
$ nothing-major -b 'npm install' -t 'npm test' test/*
The intention is that this would be setup to run as a post-commit
hook. The build script runs a bit slowly right now (which I'm guessing has to do with building in a fresh directory), so it hasn't seemed practical yet. However, I plan to experiment further.
Debugging
The script uses the debug
library. Debugging can be turned on with the -v
or --verbose
flag or the DEBUG='nothing-major'
environment variable.
Related Work
Similar breaking change detection functionality is provided by cracks
. cracks
checks test files out in the same directory, which can cause lost changes if run on an uncommitted directory. As it hasn't been updated in awhile, I decided to write something fresh.