brave-mouse v0.4.0
brave-mouse
Validate your code against your EditorConfig.
Command line interface
Install brave-mouse using:
$ npm install brave-mouse -gValidate files like this:
$ brave-mouse .travis.yml README.md package.jsonbrave-mouse automatically uses the appropiate .editorconfig.
Exit codes
brave-mouse will exit abruptly (i.e. subsequent files won’t be processed) with an exit code of 1 if it encounters an error such as being unable to read a file.
brave-mouse will exit with an exit code of 2 if all files could be processed but not all files are valid according to your .editorconfig.
If all files could be processed successfully and are valid, brave-mouse exits with an exit code of 0.
Programmatic usage
Install brave-mouse using:
$ npm install brave-mouseUse it like this:
var braveMouse = require('brave-mouse');
braveMouse.validate('your-file.js', function(err, results) {
// `err` will only be set for actual errors, e.g. it will
// not be set if your file isn’t valid.
if(err) throw err;
if(results === true) {
// Your file is valid
} else {
console.log(results);
// {
// "indent_style": {
// "expected": "tab"
// "is": "space"
// }
// }
}
});Supported EditorConfig properties
See EditorConfig’s wiki for a complete list of properties.
brave-mouse currently supports validating the following properties:
indent_styleindent_sizeend_of_line(onlylfandcrlfare supported)trim_trailing_whitespaceinsert_final_newlinemax_line_length
tab_width can’t be validated as it only applies to editors.
Running tests
First, install all dependencies:
$ npm install -g grunt-cli
$ npm installThen run the tests:
$ grunt testRelease History
See CHANGELOG.md.
License
brave-mouse is licensed under the BSD 2-clause license, subject to additional terms. See LICENSE for the full license text.