From bbb6dba9781aa729bd88752224b50404c7ac9bd2 Mon Sep 17 00:00:00 2001 From: Yunong J Xiao Date: Sun, 27 Sep 2015 22:46:31 -0700 Subject: [PATCH] 80 columns everywhere like God intended --- .jscsrc | 5 +++-- README.md | 2 +- lib/helpers.js | 10 ++++++---- lib/httpErrors.js | 8 +++++--- lib/restErrors.js | 14 ++++++++------ 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.jscsrc b/.jscsrc index d98778e..7548bac 100644 --- a/.jscsrc +++ b/.jscsrc @@ -15,8 +15,8 @@ // alignment rules "maximumLineLength": { "value": 80, - "allowComments": true, - "allowUrlComments": true, + "allowComments": false, + "allowUrlComments": false, "allowRegex": true }, "validateIndentation": 4, @@ -38,6 +38,7 @@ "disallowSpacesInFunction": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideParentheses": true, "disallowSpacesInCallExpression": true, "disallowTrailingComma": true, "disallowTrailingWhitespace": true, diff --git a/README.md b/README.md index c9ce12a..6a31433 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![Dependency Status](https://david-dm.org/restify/errors.svg)](https://david-dm.org/restify/errors) [![devDependency Status](https://david-dm.org/restify/errors/dev-status.svg)](https://david-dm.org/restify/errors#info=devDependencies) [![bitHound Score](https://www.bithound.io/github/restify/errors/badges/score.svg)](https://www.bithound.io/github/restify/errors/master) -[![NSP Status](https://img.shields.io/badge/NSP%20status-vulnerabilities%20found-red.svg)](https://travis-ci.org/restify/errors) +[![NSP Status](https://img.shields.io/badge/NSP%20status-no%20vulnerabilities-green.svg)](https://travis-ci.org/restify/errors) > A collection of HTTP and REST Error constructors. diff --git a/lib/helpers.js b/lib/helpers.js index b62e428..275c8af 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -21,8 +21,10 @@ var assert = require('assert-plus'); * 4) new HttpError(anotherErr, '', ''); * @public * @function parseVariadicArgs - * @param {Object} ctorArgs the passed in arguments object to error constructor - * @param {Boolean} werrorSuper if the super being invoked is going to WError + * @param {Object} ctorArgs the passed in arguments object to error + * constructor + * @param {Boolean} werrorSuper if the super being invoked is going to + * WError * @returns {Object} */ function parseVariadicArgs(ctorArgs, werrorSuper) { @@ -39,8 +41,8 @@ function parseVariadicArgs(ctorArgs, werrorSuper) { if (_.isPlainObject(arguments[1])) { options = arguments[1] || {}; - // if we're calling WError super, don't pass in the special restify - // options object. + // if we're calling WError super, don't pass in the special + // restify options object. if (werrorSuper === true) { args = [arguments[0]]; } diff --git a/lib/httpErrors.js b/lib/httpErrors.js index b90b0e3..071fb50 100644 --- a/lib/httpErrors.js +++ b/lib/httpErrors.js @@ -61,7 +61,8 @@ var httpErrors = _.reduce(http.STATUS_CODES, function(acc, desc, code) { // this is a dynamic constructor for an error message. // arguments are variadic. constructor fn name must be anonymous. /** - * Variadic signature, first two are special to Restify, using a options obj. + * Variadic signature, first two are special to Restify, using a + * options obj. * 1) new [Dynamic]Error(anotherErr, {...}); * 2) new [Dynamic]Error({...}); * Last one is a straight pass through to WError @@ -76,8 +77,9 @@ var httpErrors = _.reduce(http.STATUS_CODES, function(acc, desc, code) { util.inherits(acc[name], HttpError); /** - * assign non-standard display name property on the CONSTRUCTOR (not prototype), - * which is supported by all VMs. useful for stack trace output. + * assign non-standard display name property on the CONSTRUCTOR (not + * prototype), which is supported by all VMs. useful for stack trace + * output. * @type {String} */ acc[name].displayName = name; diff --git a/lib/restErrors.js b/lib/restErrors.js index 574af08..754e07c 100644 --- a/lib/restErrors.js +++ b/lib/restErrors.js @@ -45,7 +45,8 @@ var restErrors = _.reduce(CODES, function(acc, statusCode, errorCode) { // this is a dynamic constructor for an error message. // arguments are variadic. constructor fn name must be anonymous. /** - * Variadic signature, first two are special to Restify, using a options obj. + * Variadic signature, first two are special to Restify, using a options + * obj. * 1) new [Dynamic]Error(anotherErr, {...}); * 2) new [Dynamic]Error({...}); * Last one is a straight pass through to WError @@ -60,8 +61,9 @@ var restErrors = _.reduce(CODES, function(acc, statusCode, errorCode) { util.inherits(acc[name], RestError); /** - * assign non-standard display name property on the CONSTRUCTOR (not prototype), - * which is supported by all VMs. useful for stack trace output. + * assign non-standard display name property on the CONSTRUCTOR (not + * prototype), which is supported by all VMs. useful for stack trace + * output. * @type {String} */ acc[name].displayName = name; @@ -81,9 +83,9 @@ var restErrors = _.reduce(CODES, function(acc, statusCode, errorCode) { acc[name].prototype.statusCode = statusCode; /** - * the default rest code. i.e., a BadDigestError has a restCode of 'BadDigest'. - * it is basically the key for the lookup in the CODES mapping at the top of the - * file. + * the default rest code. i.e., a BadDigestError has a restCode of + * 'BadDigest'. it is basically the key for the lookup in the CODES + * mapping at the top of the file. * @type {String} */ acc[name].prototype.restCode = errorCode;