gruntjs/grunt-contrib-csslint — pull request #6 by stevenbenner (2013-03-15 14:41:13+00:00)
Title: Changed .csslintrc file support to use CSSLint specification

This pull request is related to the discussion in issue #3.

#### What this pull request adds

* Support for .csslintrc files in their native format.
* The ability to disable linting rules via the `--ignore` directive.
* The ability to exclude specific files from linting via the `--exclude-list` directive.
* The ability to set the warning level of rules via the `--errors` and `--warnings` directives. *(But they don't really affect this grunt task because even warnings will cause the task to fail and all rules are set to warnings by default)*

#### What this pull request does not add

The official .csslintrc file spec allows for *any* command line option. I left out support for the ones that I didn't think there was any reason to support. These include:

* `--help` - Obviously pointless in a grunt task.
* `--format` - Implementing this really didn't make sense to me because it doesn't really lend itself to working with the way formatters work now.
* `--list-rules` - Doesn't belong in a grunt task.
* `--quiet` - Would anyone really like for this to affect a grunt task?
* `--version` - Another one that obviously doesn't belong in a grunt task.
* It is also possible to add files to be linted via the .csslintrc file. I was debating whether I should implement that or not, but I decided against it because grunt users must explicitly list the files/directories that they want the task to run on.

There is certainly room for discussion about supporting the omitted features. Let me know your thoughts.

#### Behavior changed by this pull request

* This pull request **drops support for JSON .csslintrc files completely**. Anyone who has built a JSON .csslintrc file will find their csslint task broken when they upgrade.

#### Code notes

* I added the .csslintrc parsing code in a file outside of the core task js. It felt more like a small library when I was writing it.
* It would be much better to use CSSLint to process config files, but CSSLint does not expose any of the CLI code where the .csshintrc related code resides. Perhaps we should consider requesting (or submitting a pull request) that CSSLint exposes the argument processing code somewhere.
* The `rcparser` exposes several convenience methods. These methods centralize the maintenance points that need to be touched if CSSLint ever changes their argument names or spec. However these might just be wasted code depending on how you look at it.
* I used the node `path` library to determine the `basePath` for the .csslintrc file and to do the file exclusion comparisons because that just feels right, but I can't find anywhere else in grunt that behaves this way. This might be an undesirable practice in grunt plugins for some reason.