commitplease
Advanced tools
Comparing version 2.1.0 to 2.2.0
{ | ||
"name": "commitplease", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Validates strings as commit messages", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,3 +5,3 @@ # Commitplease | ||
This [node.js](http://nodejs.org/) module validates git commit messages while you commit, according to the rules specified in the [jQuery Commit Guidelines](http://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines). These are pretty generic, so this module should be useful for most projects that care about commit message formats. | ||
This [node.js](http://nodejs.org/) module validates git commit messages while you commit, according to the rules specified in the [jQuery Commit Guidelines](http://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines). These are pretty generic, so this module should be useful for various projects that care about commit message formats. | ||
@@ -18,12 +18,10 @@ ## Installation | ||
Just commit as usual. This modules installs a git commit-msg hook, automatically validating all commit messages as you enter them. Invalid messages will be rejected, with details on what's wrong and a copy of the input. | ||
Just commit as usual. This modules installs a git commit-msg hook (unless suppressed, see below), automatically validating all commit messages as you enter them. Invalid messages will be rejected, with details on what's wrong and a copy of the input. | ||
By default, the commit message needs to match the [jQuery Commit Guidlines](http://contribute.jquery.org/commits-and-pull-requests/#commit-guidelines). See there for details, and below on how to change the default behaviour. | ||
In addition, a subject (the first line) starting with "fixup!" and "squash!" is considered valid. These are generated by `git commit --fixup` and `--squash`. A component in square brackets like "[Tmp]" or "[fix]" is also considered valid, to be manually squashed later. | ||
In addition, a subject (the first line) starting with "fixup!" and "squash!" is considered valid. These are generated by `git commit --fixup` and `--squash`. A component in square brackets like "[Tmp]" or "[fix]" is also considered valid, to be manually squashed later. Commit messages for merges like "Merge branch [...]" or "Merge <commitish> into <commitish>" are considered valid as well. | ||
## API | ||
*The API is a work-in-progress* | ||
```js | ||
@@ -69,3 +67,3 @@ var validate = require('commitplease/lib/validate'); | ||
"devDependencies": { | ||
"commitplease": "1.10.x" | ||
"commitplease": "latest" | ||
}, | ||
@@ -78,5 +76,18 @@ "commitplease": { | ||
In addition, you can specify the `nohook` option as something truthy, which prevents installation of the git commit-msg hook. This can be used when wrapping the commitplease validation API into another module, like a [grunt plugin](https://github.com/rxaviers/grunt-commitplease/). | ||
```json | ||
{ | ||
"dependencies": { | ||
"commitplease": "latest" | ||
}, | ||
"commitplease": { | ||
"nohook": true | ||
} | ||
} | ||
``` | ||
## License | ||
Copyright 2014 Jörn Zaefferer. Released under the terms of the MIT license. | ||
Copyright Jörn Zaefferer | ||
Released under the terms of the MIT license. | ||
@@ -83,0 +94,0 @@ --- |
@@ -16,2 +16,7 @@ (function avoidSelfInstall() { | ||
if (require(path.resolve(root, "package")).commitplease.nohook) { | ||
console.error("package.json indicates to skip hook"); | ||
process.exit(0); | ||
} | ||
// Check if we are in a git repository so we can bail out early when this is not the case. | ||
@@ -18,0 +23,0 @@ if (!fs.existsSync(git) || !fs.lstatSync(git).isDirectory()) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15442
365
93
4