Skip to content

Commit

Permalink
lib,test,tools: alignment on variable assignments
Browse files Browse the repository at this point in the history
Correct alignment on variable assignments that span multiple lines in
preparation for lint rule to enforce such alignment.

PR-URL: #6869
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Johan Bergström <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
  • Loading branch information
Trott authored and Myles Borins committed Jun 23, 2016
1 parent 3745d84 commit aaeeec4
Show file tree
Hide file tree
Showing 22 changed files with 158 additions and 144 deletions.
7 changes: 4 additions & 3 deletions lib/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,10 @@ function checkExecSyncError(ret) {
ret.error = null;

if (!err) {
var msg = 'Command failed: ' +
(ret.cmd ? ret.cmd : ret.args.join(' ')) +
(ret.stderr ? '\n' + ret.stderr.toString() : '');
var msg = 'Command failed: ';
msg += ret.cmd || ret.args.join(' ');
if (ret.stderr)
msg += '\n' + ret.stderr.toString();
err = new Error(msg);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ exports._builtinLibs = ['assert', 'buffer', 'child_process', 'cluster',
'string_decoder', 'tls', 'tty', 'url', 'util', 'v8', 'vm', 'zlib'];


const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, ' +
'const, function, class) not yet supported outside strict mode';
const BLOCK_SCOPED_ERROR = 'Block-scoped declarations (let, const, function, ' +
'class) not yet supported outside strict mode';


class LineParser {
Expand Down
9 changes: 6 additions & 3 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,12 @@ function formatPrimitive(ctx, value) {
var type = typeof value;

if (type === 'string') {
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
.replace(/\\"/g, '"') + '\'';
var simple = '\'' +
JSON.stringify(value)
.replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
.replace(/\\"/g, '"') +
'\'';
return ctx.stylize(simple, 'string');
}
if (type === 'number') {
Expand Down
4 changes: 2 additions & 2 deletions lib/zlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const binding = process.binding('zlib');
const util = require('util');
const assert = require('assert').ok;
const kMaxLength = require('buffer').kMaxLength;
const kRangeErrorMessage = 'Cannot create final Buffer. ' +
'It would be larger than 0x' + kMaxLength.toString(16) + ' bytes.';
const kRangeErrorMessage = 'Cannot create final Buffer. It would be larger ' +
'than 0x' + kMaxLength.toString(16) + ' bytes.';

// zlib doesn't provide these, so kludge them in following the same
// const naming scheme zlib uses.
Expand Down
40 changes: 20 additions & 20 deletions test/parallel/test-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,17 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64'));
{
// big example
const quote = 'Man is distinguished, not only by his reason, but by this ' +
'singular passion from other animals, which is a lust ' +
'of the mind, that by a perseverance of delight in the ' +
'continued and indefatigable generation of knowledge, exceeds ' +
'the short vehemence of any carnal pleasure.';
'singular passion from other animals, which is a lust ' +
'of the mind, that by a perseverance of delight in the ' +
'continued and indefatigable generation of knowledge, ' +
'exceeds the short vehemence of any carnal pleasure.';
const expected = 'TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb' +
'24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBh' +
'bmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnk' +
'gYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIG' +
'FuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBle' +
'GNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVh' +
'c3VyZS4=';
'24sIGJ1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlci' +
'BhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQ' +
'gYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu' +
'dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZ' +
'GdlLCBleGNlZWRzIHRoZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm' +
'5hbCBwbGVhc3VyZS4=';
assert.equal(expected, (new Buffer(quote)).toString('base64'));

let b = new Buffer(1024);
Expand All @@ -484,11 +484,11 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64'));

// check that the base64 decoder ignores whitespace
const expectedWhite = expected.slice(0, 60) + ' \n' +
expected.slice(60, 120) + ' \n' +
expected.slice(120, 180) + ' \n' +
expected.slice(180, 240) + ' \n' +
expected.slice(240, 300) + '\n' +
expected.slice(300, 360) + '\n';
expected.slice(60, 120) + ' \n' +
expected.slice(120, 180) + ' \n' +
expected.slice(180, 240) + ' \n' +
expected.slice(240, 300) + '\n' +
expected.slice(300, 360) + '\n';
b = new Buffer(1024);
bytesWritten = b.write(expectedWhite, 0, 'base64');
assert.equal(quote.length, bytesWritten);
Expand All @@ -502,11 +502,11 @@ assert.equal('TWFu', (new Buffer('Man')).toString('base64'));

// check that the base64 decoder ignores illegal chars
const expectedIllegal = expected.slice(0, 60) + ' \x80' +
expected.slice(60, 120) + ' \xff' +
expected.slice(120, 180) + ' \x00' +
expected.slice(180, 240) + ' \x98' +
expected.slice(240, 300) + '\x03' +
expected.slice(300, 360);
expected.slice(60, 120) + ' \xff' +
expected.slice(120, 180) + ' \x00' +
expected.slice(180, 240) + ' \x98' +
expected.slice(240, 300) + '\x03' +
expected.slice(300, 360);
b = new Buffer(expectedIllegal, 'base64');
assert.equal(quote.length, b.length);
assert.equal(quote, b.toString('ascii', 0, quote.length));
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function checkResults(expected_results, results) {
const expected = expected_results[k];

var msg = (expected[1] || '') +
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');

if (expected && expected.length) {
assert.equal(actual, expected[0], msg);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-cluster-worker-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function checkResults(expected_results, results) {
const expected = expected_results[k];

var msg = (expected[1] || '') +
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
(' [expected: ' + expected[0] + ' / actual: ' + actual + ']');
if (expected && expected.length) {
assert.equal(actual, expected[0], msg);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ if (process.argv[2] === 'child') {

child.on('exit', function onExit(exitCode, signal) {
const errMsg = 'Test at index ' + testIndex + ' should have aborted ' +
'but instead exited with exit code ' + exitCode + ' and signal ' +
signal;
'but instead exited with exit code ' + exitCode +
' and signal ' + signal;
assert(common.nodeProcessAborted(exitCode, signal), errMsg);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-error-reporting.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var exits = 0;

function errExec(script, callback) {
var cmd = '"' + process.argv[0] + '" "' +
path.join(common.fixturesDir, script) + '"';
path.join(common.fixturesDir, script) + '"';
return exec(cmd, function(err, stdout, stderr) {
// There was some error
assert.ok(err);
Expand Down
12 changes: 6 additions & 6 deletions test/parallel/test-fs-append-file-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ var currentFileData = 'ABCD';

var num = 220;
var data = '南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,疆域包括今天中国的广东、' +
'广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' +
'南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。' +
'前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' +
'南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,' +
'历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,' +
'它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n';
'广西两省区的大部份地区,福建省、湖南、贵州、云南的一小部份地区和越南的北部。' +
'南越国是秦朝灭亡后,由南海郡尉赵佗于前203年起兵兼并桂林郡和象郡后建立。' +
'前196年和前179年,南越国曾先后两次名义上臣属于西汉,成为西汉的“外臣”。前112年,' +
'南越国末代君主赵建德与西汉发生战争,被汉武帝于前111年所灭。南越国共存在93年,' +
'历经五代君主。南越国是岭南地区的第一个有记载的政权国家,采用封建制和郡县制并存的制度,' +
'它的建立保证了秦末乱世岭南地区社会秩序的稳定,有效的改善了岭南地区落后的政治、##济现状。\n';

common.refreshTmpDir();

Expand Down
32 changes: 16 additions & 16 deletions test/parallel/test-http-1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ function test(handler, request_generator, response_validator) {
}

function response_validator(server_response, client_got_eof, timed_out) {
var expected_response = ('HTTP/1.1 200 OK\r\n' +
'Content-Type: text/plain\r\n' +
'Connection: close\r\n' +
'\r\n' +
'Hello, world!');
var expected_response = 'HTTP/1.1 200 OK\r\n' +
'Content-Type: text/plain\r\n' +
'Connection: close\r\n' +
'\r\n' +
'Hello, world!';

assert.equal(expected_response, server_response);
assert.equal(true, client_got_eof);
Expand Down Expand Up @@ -125,17 +125,17 @@ function test(handler, request_generator, response_validator) {
}

function response_validator(server_response, client_got_eof, timed_out) {
var expected_response = ('HTTP/1.1 200 OK\r\n' +
'Content-Type: text/plain\r\n' +
'Connection: close\r\n' +
'Transfer-Encoding: chunked\r\n' +
'\r\n' +
'7\r\n' +
'Hello, \r\n' +
'6\r\n' +
'world!\r\n' +
'0\r\n' +
'\r\n');
var expected_response = 'HTTP/1.1 200 OK\r\n' +
'Content-Type: text/plain\r\n' +
'Connection: close\r\n' +
'Transfer-Encoding: chunked\r\n' +
'\r\n' +
'7\r\n' +
'Hello, \r\n' +
'6\r\n' +
'world!\r\n' +
'0\r\n' +
'\r\n';

assert.equal(expected_response, server_response);
assert.equal(true, client_got_eof);
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-path.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ assert.equal(path.win32.dirname('\\\\unc\\share\\foo\\bar\\'),
assert.equal(path.win32.dirname('\\\\unc\\share\\foo\\bar\\baz'),
'\\\\unc\\share\\foo\\bar');


assert.equal(path.extname(''), '');
assert.equal(path.extname('/path/to/file'), '');
assert.equal(path.extname('/path/to/file.ext'), '.ext');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-readline-undefined-columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ oStream.on('data', function(data) {

oStream.on('end', function() {
const expect = 'process.stdout\r\n' +
'process.stdin\r\n' +
'process.stderr';
'process.stdin\r\n' +
'process.stderr';
assert(new RegExp(expect).test(output));
});

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-stdin-from-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var stdoutScript = join(common.fixturesDir, 'echo-close-check.js');
var tmpFile = join(common.tmpDir, 'stdin.txt');

var cmd = '"' + process.argv[0] + '" "' + stdoutScript + '" < "' +
tmpFile + '"';
tmpFile + '"';

var string = 'abc\nümlaut.\nsomething else\n' +
'南越国是前203年至前111年存在于岭南地区的一个国家,国都位于番禺,' +
Expand Down
43 changes: 23 additions & 20 deletions test/parallel/test-tls-cert-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,29 @@ if (!common.hasCrypto) {
var tls = require('tls');


var cert = '-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N/LgGAQoxwovfjcOYNnZsIVY
-----END RSA PRIVATE KEY-----`;

function test(cert, key, cb) {
var server = tls.createServer({
Expand Down
63 changes: 33 additions & 30 deletions test/parallel/test-tls-econnreset.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,41 @@ if (!common.hasCrypto) {
}
var tls = require('tls');

var cacert = '-----BEGIN CERTIFICATE-----\n' +
'MIIBxTCCAX8CAnXnMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD\n' +
'VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n\n' +
'TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv\n' +
'bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMH0xCzAJ\n' +
'BgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZ\n' +
'MBcGA1UEChMQU3Ryb25nTG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRow\n' +
'GAYDVQQDExFjYS5zdHJvbmdsb29wLmNvbTBMMA0GCSqGSIb3DQEBAQUAAzsAMDgC\n' +
'MQDKbQ6rIR5t1q1v4Ha36jrq0IkyUohy9EYNvLnXUly1PGqxby0ILlAVJ8JawpY9\n' +
'AVkCAwEAATANBgkqhkiG9w0BAQUFAAMxALA1uS4CqQXRSAyYTfio5oyLGz71a+NM\n' +
'+0AFLBwh5AQjhGd0FcenU4OfHxyDEOJT/Q==\n' +
'-----END CERTIFICATE-----\n';
var cacert =
`-----BEGIN CERTIFICATE-----
MIIBxTCCAX8CAnXnMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD
VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n
TG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2luLDp//6dyHBMexDCQznkhZKRU\n' +
'-----END CERTIFICATE-----\n';
var cert =
`-----BEGIN CERTIFICATE-----
MIIBfDCCATYCAgQaMA0GCSqGSIb3DQEBBQUAMH0xCzAJBgNVBAYTAlVTMQswCQYD
VQQIEwJDQTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQU3Ryb25n
TG9vcCwgSW5jLjESMBAGA1UECxMJU3Ryb25nT3BzMRowGAYDVQQDExFjYS5zdHJv
bmdsb29wLmNvbTAeFw0xNDAxMTcyMjE1MDdaFw00MTA2MDMyMjE1MDdaMBkxFzAV
BgNVBAMTDnN0cm9uZ2xvb3AuY29tMEwwDQYJKoZIhvcNAQEBBQADOwAwOAIxAMfk
I0LWU15pPUwIQNMnRVhhOibi0TQmAau8FBtgwEfGK01WpfGUaJr1a41K8Uq7xwID
AQABoxkwFzAVBgNVHREEDjAMhwQAAAAAhwR/AAABMA0GCSqGSIb3DQEBBQUAAzEA
cGpYrhkrb7mIh9DNhV0qp7pGjqBzlHqB7KQXw2luLDp//6dyHBMexDCQznkhZKRU
-----END CERTIFICATE-----`;

var key = '-----BEGIN RSA PRIVATE KEY-----\n' +
'MIH0AgEAAjEAx+QjQtZTXmk9TAhA0ydFWGE6JuLRNCYBq7wUG2DAR8YrTVal8ZRo\n' +
'mvVrjUrxSrvHAgMBAAECMBCGccvSwC2r8Z9Zh1JtirQVxaL1WWpAQfmVwLe0bAgg\n' +
'/JWMU/6hS36TsYyZMxwswQIZAPTAfht/zDLb7Hwgu2twsS1Ra9w/yyvtlwIZANET\n' +
'26votwJAHK1yUrZGA5nnp5qcmQ/JUQIZAII5YV/UUZvF9D/fUplJ7puENPWNY9bN\n' +
'pQIZAMMwxuS3XiO7two2sQF6W+JTYyX1DPCwAQIZAOYg1TvEGT38k8e8jygv8E8w\n' +
'YqrWTeQFNQ==\n' +
'-----END RSA PRIVATE KEY-----\n';
var key =
`-----BEGIN RSA PRIVATE KEY-----
MIH0AgEAAjEAx+QjQtZTXmk9TAhA0ydFWGE6JuLRNCYBq7wUG2DAR8YrTVal8ZRo
mvVrjUrxSrvHAgMBAAECMBCGccvSwC2r8Z9Zh1JtirQVxaL1WWpAQfmVwLe0bAgg
/JWMU/6hS36TsYyZMxwswQIZAPTAfht/zDLb7Hwgu2twsS1Ra9w/yyvtlwIZANET
26votwJAHK1yUrZGA5nnp5qcmQ/JUQIZAII5YV/UUZvF9D/fUplJ7puENPWNY9bN
pQIZAMMwxuS3XiO7two2sQF6W+JTYyX1DPCwAQIZAOYg1TvEGT38k8e8jygv8E8w
YqrWTeQFNQ==
-----END RSA PRIVATE KEY-----`;

var ca = [ cert, cacert ];

Expand Down
6 changes: 3 additions & 3 deletions test/parallel/test-tls-parse-cert-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ require('../common');
const assert = require('assert');
const tls = require('tls');

const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\nCN=ca1\n'
+ 'emailAddress[email protected]';
const singles = 'C=US\nST=CA\nL=SF\nO=Node.js Foundation\nOU=Node.js\n' +
'CN=ca1\nemailAddress[email protected]';
const singlesOut = tls.parseCertString(singles);
assert.deepEqual(singlesOut, {
C: 'US',
Expand All @@ -18,7 +18,7 @@ assert.deepEqual(singlesOut, {
});

const doubles = 'OU=Domain Control Validated\nOU=PositiveSSL Wildcard\n' +
'CN=*.nodejs.org';
'CN=*.nodejs.org';
const doublesOut = tls.parseCertString(doubles);
assert.deepEqual(doublesOut, {
OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ],
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-vm-static-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ assert.equal(2, global.hello);

console.error('pass values');
var code = 'foo = 1;' +
'bar = 2;' +
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
'bar = 2;' +
'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');';
global.foo = 2;
global.obj = { foo: 0, baz: 3 };
/* eslint-disable no-unused-vars */
Expand Down
Loading

0 comments on commit aaeeec4

Please sign in to comment.