gulp-solemn
A gulp plugin to detect inappropriate language in your code.
Overview
The plugin prints violation messages to the console when it encounters inappropriate language in your JS or CSS files. Each word is associated to one or more violation categories. For example, you might associate the word "beefcake" with the violation category "sexist". You can add your own custom dictionaries to specify words that cause violations.
Dictionary Format
Each custom dictionary is a JSON file with the following format:
"word1": "category1" "category3" "word2": "category2" "word3": "category1" "word4": "category2" "category3" "category4"
Every word must have at least one violation category. If multiple dictionaries are specified, words and their categories are merged.
Usage
var gulp = ;var solemn = ; // simple examplevar simpleSolemnOptions = printViolationMessages: true // whether to print the violations to the console includeDefaultDictionary: true // whether to include the default dictionary as well; gulp // custom reporter examplevar simpleSolemnOptions = printViolationMessages: true { console; }; gulp // load a custom custom dictionary and// do something with each file's set of violation objectsvar perFileSolemnOptions = { // the violations and corresponding violation messages for a particular file console; violations; } dictionaries: 'test/fixtures/dictionary1.json' 'test/fixtures/dictionary2.json' includeDefaultDictionary: false printViolationMessages: false; gulp // load a custom custom dictionary and// do something with each file's set of violation objectsvar allFilesSolemnOptions = { // the violations and corresponding violation messages for all files after they have been processed violations; // already formatted violation messages // same as what is printed when printViolationMessages === true violationMessages } dictionaries: 'test/fixtures/dictionary1.json' 'test/fixtures/dictionary2.json' includeDefaultDictionary: false printViolationMessages: false; gulp
Test
To test the module, run the follow from the command line:
npm test