Skip to content

julien-leroy/check-build

 
 

Repository files navigation

Check-build - Verify that your NodeJS project follow team conventions, is well written, up to date and secure.

“Each time I start a new project/mvp/poc/module I don't want to create/edit a new grunt/gulp file or whatever hype dev use these days. I want an already packed CLI with good defaults (mine) that I can drop into my continuous build/integration process. Let's build that once and for all.”

– 10/19/2014

Usage

Deps Version

npm install check-build -g
cd /path/to/your/project
check-build
# [...] (sub-module output)
echo $?
# 0 if everything went right, 1 otherwise.

What's inside

Code error and potential problem detection

  • JSHint Static analysis tool for JavaScript (using JSHint stylish). If .jshintrc is not present in project root, check-build will use this .jshintrc.

[To be implemented]: FixMyJS Automatically fix silly lint errors.

Code style checking

  • JSCS Check the code style of your code. If .jscsrc is not present in project root, check-build will use this .jscsrc.

D.R.Y

  • JSInspect Detect structural similarities in your code.
  • buddy.js Detect magic number in your code.

Freshness

  • David Check that your project dependencies are up to date.

Security

  • Nsp Check your project dependencies for security issues.

Philosophy

  • Leverage simplicity over performance. check-build will be run automatically by a build bot. I #%£€)° don't care about performance, I want code quality and ease of use.
  • Don't reinvent the wheel, leverage each module own configuration file. E.g. .jshintrc.
  • Even if the underneath module is not capable of handling multiple files, abstract it.
  • Use multimatch everywhere.
  • .checkbuild is there to configure each module (in case they don't use dot files for configuration), checkbuild will forward these parameters to each module implementation.

Checkbuild configuration

Put a .checkbuild file (example) in your project root directory.

{
  "checkbuild": {
    "enable": ["jshint", "jscs", "jsinspect", "nsp", "david"],
    // don't exit immediately if one of the tools reports an error (default true)
    "continueOnError": true,
    // don't exit(1) even if we had some failures (default false)
    "allowFailures": false
  },

  "david": {
    "warn": {
      "E404": true
    }
    // ... and so on.
  },

  "jshint": {
    "args": ["src/**/*.js"]
    // ... and so on.
  },

  "jscs": {
    "args": ["lib/**.js"]
    // ... and so on.
  },

  "jsinspect": {
    "args": ["*.js"],
    "diff": true
    // ... and so on.
  },

  "buddyjs": {
    "args": ["*.js"],
    "ignore": [0, 1, 200]
    // ... and so on.
  },

  "nsp": {}
}

Final goal

A (NodeJS) project can be automatically analyzed in many dimension like code-consistency, d-r-y-ness and security. Check-build's final goal is to take the human out of the loop.

About

Check-build - Verifies that your NodeJS project follow team conventions, is well written, up to date and secure.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%