bower/bower — pull request #1145 by ruyadorno (2014-03-02 17:42:14+00:00)
Title: Iss 1014

This PR implements the basic `bower.json` validation that I had started in my [checkbower](https://github.com/ruyadorno/checkbower) project, currently it only validates the following:

- if a valid `bower.json` file can be found and parsed
- checks if a name property exists and is not empty
- checks if a version property exists and is a valid [semver](http://semver.org/) value

## Usage

# validates the bower.json file on the current folder
bower validate

# validates a given bower.json file
bower validate ~/path/to/package/bower.json

I think these are the most basic checks we can make to ensure a `bower.json` file is valid and it avoids the most annoying mistake of using invalid json files (you can't imagine how many times I pushed malformed bower.json files to my repos just because of a missing comma). I can keep extending the validation with the other ideas from #1014 from here.

Also, I implemented tests for the new validate command, which slightly relates to #801

Please let me know if any improvements are needed, I tried to follow the coding style and using of other libs from the existing files the best I could but I know how bad we can make mistakes when we are new to the codebase :)