From 1c67b6d30f5f062661d43bc6e9decf8181d0e1d6 Mon Sep 17 00:00:00 2001 From: YoshinoriN Date: Fri, 12 Oct 2018 20:05:28 +0900 Subject: [PATCH 1/4] Update mocha 5.2.0 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index c5c4ba9..46b4e63 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "jscs": "^3.0.4", "jscs-preset-hexo": "^1.0.1", "mocha": "^2.5.3" + "mocha": "^5.2.0" }, "dependencies": { "babel-eslint": "^7.2.1", From 7f378481ea61cc758701a7c386b1ccfe9cf3efaf Mon Sep 17 00:00:00 2001 From: YoshinoriN Date: Fri, 12 Oct 2018 20:06:21 +0900 Subject: [PATCH 2/4] Delete jscs & update eslint --- .jscsrc | 4 ---- .travis.yml | 1 - package.json | 8 ++------ 3 files changed, 2 insertions(+), 11 deletions(-) delete mode 100644 .jscsrc diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 6cdb7d0..0000000 --- a/.jscsrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "excludeFiles": ["node_modules/**", "coverage/**", "tmp/**"], - "preset": "hexo" -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index e56d2e8..ad90d60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,6 @@ before_script: script: - npm run eslint - - npm run jscs - npm run test-cov after_script: diff --git a/package.json b/package.json index 46b4e63..f2a4750 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "main": "index", "scripts": { "eslint": "eslint .", - "jscs": "jscs .", "test": "mocha test/index.js", "test-cov": "istanbul cover --print both _mocha -- test/index.js" }, @@ -27,12 +26,9 @@ "license": "MIT", "devDependencies": { "chai": "^3.5.0", - "eslint": "^2.12.0", - "eslint-config-hexo": "^1.0.3", + "eslint": "^5.6.1", + "eslint-config-hexo": "^3.0.0", "istanbul": "^0.4.3", - "jscs": "^3.0.4", - "jscs-preset-hexo": "^1.0.1", - "mocha": "^2.5.3" "mocha": "^5.2.0" }, "dependencies": { From acdfa8f15e65d6b91411a3c0f9ec1be3a9db2e06 Mon Sep 17 00:00:00 2001 From: YoshinoriN Date: Fri, 12 Oct 2018 20:13:42 +0900 Subject: [PATCH 3/4] Fix indent --- test/deployer.js | 178 +++++++++++++++++++++++------------------------ 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/test/deployer.js b/test/deployer.js index 78b8c98..0312750 100644 --- a/test/deployer.js +++ b/test/deployer.js @@ -99,21 +99,21 @@ describe('deployer', function() { var extendDirName = pathFn.basename(extendDir); return fs.writeFile(pathFn.join(extendDir, 'ext.txt'), 'ext') - .then(function() { - return deployer({ - repo: fakeRemote, - extend_dirs: extendDirName, - silent: true + .then(function() { + return deployer({ + repo: fakeRemote, + extend_dirs: extendDirName, + silent: true + }); + }).then(function() { + return validate(); + }).then(function() { + var extTxtFile = pathFn.join(validateDir, extendDirName, 'ext.txt'); + + return fs.readFile(extTxtFile); + }).then(function(content) { + content.should.eql('ext'); }); - }).then(function() { - return validate(); - }).then(function() { - var extTxtFile = pathFn.join(validateDir, extendDirName, 'ext.txt'); - - return fs.readFile(extTxtFile); - }).then(function(content) { - content.should.eql('ext'); - }); }); it('multi deployment', function() { @@ -136,41 +136,41 @@ describe('deployer', function() { it('hidden file', function() { return fs.writeFile(pathFn.join(publicDir, '.hid'), 'hidden') - .then(function() { - return deployer({ - repo: fakeRemote, - ignore_hidden: false, - silent: true + .then(function() { + return deployer({ + repo: fakeRemote, + ignore_hidden: false, + silent: true + }); + }).then(function() { + return validate(); + }).then(function() { + return fs.readFile(pathFn.join(validateDir, '.hid')); + }).then(function(content) { + content.should.eql('hidden'); }); - }).then(function() { - return validate(); - }).then(function() { - return fs.readFile(pathFn.join(validateDir, '.hid')); - }).then(function(content) { - content.should.eql('hidden'); - }); }); it('hidden extdir', function() { var extendDirName = pathFn.basename(extendDir); return fs.writeFile(pathFn.join(extendDir, '.hid'), 'hidden') - .then(function() { - return deployer({ - repo: fakeRemote, - extend_dirs: extendDirName, - ignore_hidden: {public: true, extend: false}, - silent: true + .then(function() { + return deployer({ + repo: fakeRemote, + extend_dirs: extendDirName, + ignore_hidden: {public: true, extend: false}, + silent: true + }); + }).then(function() { + return validate(); + }).then(function() { + var extHidFile = pathFn.join(validateDir, extendDirName, '.hid'); + + return fs.readFile(extHidFile); + }).then(function(content) { + content.should.eql('hidden'); }); - }).then(function() { - return validate(); - }).then(function() { - var extHidFile = pathFn.join(validateDir, extendDirName, '.hid'); - - return fs.readFile(extHidFile); - }).then(function(content) { - content.should.eql('hidden'); - }); }); it('hidden files', function() { @@ -182,36 +182,36 @@ describe('deployer', function() { var extFileShow = fs.writeFile(pathFn.join(extendDir, 'show'), 'show'); return Promise.all([pubFileHid, extFileHid, extFileShow]) - .then(function() { - return deployer({ - repo: fakeRemote, - extend_dirs: extendDirName, - ignore_pattern: 'hid', - silent: true + .then(function() { + return deployer({ + repo: fakeRemote, + extend_dirs: extendDirName, + ignore_pattern: 'hid', + silent: true + }); + }).then(function() { + return validate(); + }).then(function() { + var isPubFileHidExisits = fs.exists(pathFn.join(validateDir, 'hid')); + var isExtFileHidExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'hid')); + var isExtFileShowExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'show')); + + return Promise.all([isPubFileHidExisits, isExtFileHidExisits, isExtFileShowExisits]); + }).then(function(statusLists) { + var pubFileHidStatus = statusLists[0]; + var extFileHidStatus = statusLists[1]; + var extFileShowStatus = statusLists[2]; + + pubFileHidStatus.should.eql(false); + extFileHidStatus.should.eql(false); + extFileShowStatus.should.eql(true); + }).then(function() { + var extShowFile = pathFn.join(validateDir, extendDirName, 'show'); + + return fs.readFile(extShowFile); + }).then(function(content) { + content.should.eql('show'); }); - }).then(function() { - return validate(); - }).then(function() { - var isPubFileHidExisits = fs.exists(pathFn.join(validateDir, 'hid')); - var isExtFileHidExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'hid')); - var isExtFileShowExisits = fs.exists(pathFn.join(validateDir, extendDirName, 'show')); - - return Promise.all([isPubFileHidExisits, isExtFileHidExisits, isExtFileShowExisits]); - }).then(function(statusLists) { - var pubFileHidStatus = statusLists[0]; - var extFileHidStatus = statusLists[1]; - var extFileShowStatus = statusLists[2]; - - pubFileHidStatus.should.eql(false); - extFileHidStatus.should.eql(false); - extFileShowStatus.should.eql(true); - }).then(function() { - var extShowFile = pathFn.join(validateDir, extendDirName, 'show'); - - return fs.readFile(extShowFile); - }).then(function(content) { - content.should.eql('show'); - }); }); it('hidden extFiles', function() { @@ -223,25 +223,25 @@ describe('deployer', function() { var pubFileHid = fs.writeFile(pathFn.join(publicDir, 'hid'), 'hidden'); return Promise.all([extFileHid, extFile2Hid, pubFileHid]) - .then(function() { - return deployer({ - repo: fakeRemote, - extend_dirs: extendDirName, - ignore_pattern: {public: 'hid', extend: '.'}, - silent: true + .then(function() { + return deployer({ + repo: fakeRemote, + extend_dirs: extendDirName, + ignore_pattern: {public: 'hid', extend: '.'}, + silent: true + }); + }).then(function() { + return validate(); + }).then(function() { + var isExtHidFileExists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid')); + var isExtHidFile2Exists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid2')); + var isPubHidFileExists = fs.exists(pathFn.join(validateDir, 'hid')); + + return Promise.all([isExtHidFileExists, isExtHidFile2Exists, isPubHidFileExists]); + }).then(function(statusLists) { + statusLists.forEach(function(statusItem) { + statusItem.should.eql(false); + }); }); - }).then(function() { - return validate(); - }).then(function() { - var isExtHidFileExists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid')); - var isExtHidFile2Exists = fs.exists(pathFn.join(validateDir, extendDirName, 'hid2')); - var isPubHidFileExists = fs.exists(pathFn.join(validateDir, 'hid')); - - return Promise.all([isExtHidFileExists, isExtHidFile2Exists, isPubHidFileExists]); - }).then(function(statusLists) { - statusLists.forEach(function(statusItem) { - statusItem.should.eql(false); - }); - }); }); }); From de9fadb9e95911a1b26338d6535c292816903614 Mon Sep 17 00:00:00 2001 From: YoshinoriN Date: Fri, 12 Oct 2018 20:39:15 +0900 Subject: [PATCH 4/4] Disable no-useless-escape of eslint rule on repository regular expression line --- lib/parse_config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parse_config.js b/lib/parse_config.js index 821277d..3c2dce5 100644 --- a/lib/parse_config.js +++ b/lib/parse_config.js @@ -1,6 +1,6 @@ 'use strict'; -var rRepoURL = /^(?:(?:git|https?|git\+https|git\+ssh):\/\/)?(?:[^@]+@)?([^\/]+?)[\/:](.+?)\.git$/; +var rRepoURL = /^(?:(?:git|https?|git\+https|git\+ssh):\/\/)?(?:[^@]+@)?([^\/]+?)[\/:](.+?)\.git$/; // eslint-disable-line no-useless-escape var rGithubPage = /\.github\.(io|com)$/; function parseRepo(repo) {