1.3.0 • Published 8 years ago

grunt-solemn v1.3.0

Weekly downloads
2
License
-
Repository
github
Last release
8 years ago

grunt-solemn

A grunt task for detecting inappropriate language in your code.

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-solemn --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-solemn');

The "solemn" task

Overview

In your project's Gruntfile, add a section named solemn to the data object passed into grunt.initConfig().

grunt.initConfig({
  solemn: {
    options: {
    },
    files: {
      'css': ['styles/*.css'],
      'js': ['scripts/*.js']
    },
  },
});

Options

options.dictionaries

Type: array Default value: []

An array value that includes a list of paths for custom dictionaries. Each 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 category. If multiple dictionaries are specified, words and their categories are merged.

options.exitOnViolation

Type: Boolean Default value: false

A boolean value that is used to determine if grunt should exit if it finds a violation.

Usage Examples

Default Options

grunt.initConfig({
  solemn: {
    options: {},
    files: {
      'css': ['styles/*.css'],
      'js': ['scripts/*.js']
    },
  },
});

Custom Options

grunt.initConfig({
  solemn: {
    options: {
      exitOnViolation: true,
      dictionaries: ['dictionary1.json', 'dictionary2.json']
    },
    files: {
      'css': ['styles/*.css'],
      'js': ['scripts/*.js']
    },
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

(Nothing yet)

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago