Skip to content

Commit

Permalink
tools: disallow mixed spaces and tabs for indents
Browse files Browse the repository at this point in the history
Enable eslint rule disallowing mixing tabs and spaces for indentation.
Modify the one file that had been mixing tabs and spaces.

PR-URL: #5135
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
  • Loading branch information
Trott authored and rvagg committed Feb 9, 2016
1 parent 21fd149 commit 86f8477
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ rules:
max-len: [2, 80, 2]
## require parens for Constructor
new-parens: 2
## disallow mixed spaces and tabs for indentation
no-mixed-spaces-and-tabs: 2
## max 2 consecutive empty lines
no-multiple-empty-lines: [2, {max: 2}]
## no trailing spaces
Expand Down
14 changes: 8 additions & 6 deletions test/parallel/test-crypto-certificate.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ var certificate = new crypto.Certificate();
assert.equal(certificate.verifySpkac(spkacValid), true);
assert.equal(certificate.verifySpkac(spkacFail), false);

assert.equal(stripLineEndings(certificate.exportPublicKey(spkacValid)
.toString('utf8')),
stripLineEndings(spkacPem.toString('utf8')));
assert.equal(
stripLineEndings(certificate.exportPublicKey(spkacValid).toString('utf8')),
stripLineEndings(spkacPem.toString('utf8'))
);
assert.equal(certificate.exportPublicKey(spkacFail), '');

assert.equal(certificate.exportChallenge(spkacValid)
.toString('utf8'),
'fb9ab814-6677-42a4-a60c-f905d1a6924d');
assert.equal(
certificate.exportChallenge(spkacValid).toString('utf8'),
'fb9ab814-6677-42a4-a60c-f905d1a6924d'
);
assert.equal(certificate.exportChallenge(spkacFail), '');

function stripLineEndings(obj) {
Expand Down

0 comments on commit 86f8477

Please sign in to comment.