Coder Social home page Coder Social logo

mpmedia / check-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fgribreau/check-build

0.0 2.0 0.0 70 KB

Check-build verify that your NodeJS project follow team conventions, is well written and secure.

Home Page: http://blog.fgribreau.com/2014/10/check-build-verify-that-your-nodejs.html

License: MIT License

check-build's Introduction

Check-build verify that your NodeJS project follow team conventions, is well written and secure.

“Each time I start a new project/mvp/poc/module I don't want to create/edit a new make/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.

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 (if necessary), 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", "buddyjs", "nsp"]
  },

  "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": {}
}

Todo

  • Fork jsinspect to read a .jsinspect file
  • Fork buddyjs to read a .buddyjs file

Final goal

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

check-build's People

Contributors

fgribreau avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.