Skip to content

Commit

Permalink
80 columns everywhere like God intended
Browse files Browse the repository at this point in the history
  • Loading branch information
yunong committed Sep 28, 2015
1 parent 59beadf commit bbb6dba
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
5 changes: 3 additions & 2 deletions .jscsrc
Expand Up @@ -15,8 +15,8 @@
// alignment rules
"maximumLineLength": {
"value": 80,
"allowComments": true,
"allowUrlComments": true,
"allowComments": false,
"allowUrlComments": false,
"allowRegex": true
},
"validateIndentation": 4,
Expand All @@ -38,6 +38,7 @@
"disallowSpacesInFunction": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideParentheses": true,
"disallowSpacesInCallExpression": true,
"disallowTrailingComma": true,
"disallowTrailingWhitespace": true,
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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.
Expand Down
10 changes: 6 additions & 4 deletions lib/helpers.js
Expand Up @@ -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) {
Expand All @@ -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]];
}
Expand Down
8 changes: 5 additions & 3 deletions lib/httpErrors.js
Expand Up @@ -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
Expand All @@ -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;
Expand Down
14 changes: 8 additions & 6 deletions lib/restErrors.js
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit bbb6dba

Please sign in to comment.