Skip to content
This repository has been archived by the owner on May 27, 2019. It is now read-only.

Commit

Permalink
Update linting
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-sokolov committed Aug 17, 2015
1 parent c334c0a commit 56395c1
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"devDependencies": {
"coveralls": "^2.11.2",
"eslint": "^0.21.0",
"eslint-config-useclark": "^1.0.1",
"eslint": "^1.1.0",
"eslint-config-useclark": "^2.0.0",
"istanbul": "^0.3.5",
"jshint": "^2.6.0",
"tap-colorize": "^1.2.0",
Expand Down
9 changes: 9 additions & 0 deletions src/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ var clients = require('./clients');
* Ignored statements in this function refer to the portions of the source code
* that deal with such options combinations that do not allow for fake clients
* to be injected.
* @param {object} options
* @return {object}
*/
var deployOptions = function(options){
/* istanbul ignore if */
Expand Down Expand Up @@ -130,6 +132,13 @@ var local = function(app, options){
* ssh: function(serverAlias){ return { read, write }; }
* }
* }
*
* @param {Object} util
* @param {Function} util.progress
* @param {App} app
* @param {Function} servers
* @param {Object} options
* @return {Promise}
*/
module.exports = function(util, app, servers, options){
options = deployOptions(options);
Expand Down
4 changes: 3 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ api.comment.stream = function(chr, txt){

/**
* A function to rename files in a stream, only considering the relative path
* @param {Function} f name -> new name
* @return {Function}
*/
api.rename = function(f){
return through2.obj(function(chunk, enc, cb){
Expand Down Expand Up @@ -126,7 +128,7 @@ api.src = function(params, target){
var rest = params.slice(1);

var source = getSingleSource(first, target);
source.pipe(stream, {end:false});
source.pipe(stream, {end: false});
source.on('end', function(){
api.src(rest, target).pipe(stream);
});
Expand Down
4 changes: 2 additions & 2 deletions test/bash.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test('bash local', function(t) {

test('bash remote', function(t){
dotfiles()
.servers([{host:'example.com'}])
.servers([{host: 'example.com'}])
.bash(__dirname + '/fixtures/bash/*')
.stream('example.com').on('data', function(file){
if (file.relative !== '.bashrc') return;
Expand Down Expand Up @@ -80,7 +80,7 @@ test('bash takes raw values along globs', function(t) {
test('bash takes functions', function(t) {
t.plan(2);
var config = dotfiles()
.servers([{host:'example.com'}])
.servers([{host: 'example.com'}])
.bash(
function(server){
if (server.alias === 'example.com')
Expand Down
4 changes: 2 additions & 2 deletions test/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var dotfiles = require('..');
test('error if double settings', function (t) {
t.throws(function(){
dotfiles()
.servers([{host:'example.com', port: 3133}])
.servers([{host:'example.com', port: 3134}]);
.servers([{host: 'example.com', port: 3133}])
.servers([{host: 'example.com', port: 3134}]);
});
t.end();
});
2 changes: 1 addition & 1 deletion test/pretty.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('pretty', function (t) {
var s = dotfiles()
.bash(__dirname + '/fixtures/bash/*.sh')
.ssh('foo')
.servers([{host:'example.com', port: 3133}])
.servers([{host: 'example.com', port: 3133}])
.stream()
.pipe(dotfiles.pretty());

Expand Down
4 changes: 2 additions & 2 deletions test/remote.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var dotfiles = require('..');

test('remote', function (t) {
dotfiles()
.servers([{host:'example.com', port: 3133, alias: 'example'}])
.servers([{host: 'example.com', port: 3133, alias: 'example'}])
.stream('example').on('data', function(file){
t.equal(file.contents.toString().indexOf('Host example'), -1, 'has no self-Host rule');
t.end();
Expand All @@ -16,7 +16,7 @@ test('remote', function (t) {
test('remote throws on wrong alias', function (t) {
t.throws(function(){
dotfiles()
.servers([{host:'example.com', port: 3133, alias: 'example'}])
.servers([{host: 'example.com', port: 3133, alias: 'example'}])
.stream('wrong');
});
t.end();
Expand Down
18 changes: 9 additions & 9 deletions test/ssh.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var dotfiles = require('..');

test('ssh', function (t) {
dotfiles()
.servers([{host:'example.com', port: 3133, alias: 'example', user: 'john'}])
.servers([{host: 'example.com', port: 3133, alias: 'example', user: 'john'}])
.stream().on('data', function(file){
t.equal(file.relative, '.ssh/config', 'has .ssh/config name');
t.ok(file.contents.toString().indexOf('Host example') > -1, 'has Host rule');
Expand All @@ -28,7 +28,7 @@ test('ssh', function (t) {

test('ssh alphabetized', function (t) {
dotfiles()
.servers([{host:'b.example.com'}, {host:'a.example.com'}])
.servers([{host: 'b.example.com'}, {host: 'a.example.com'}])
.stream().on('data', function(file){
var contents = file.contents.toString();
t.ok(contents.indexOf('a.example.com') < contents.indexOf('b.example.com'));
Expand All @@ -38,7 +38,7 @@ test('ssh alphabetized', function (t) {

test('ssh empty', function (t) {
dotfiles()
.servers([{host:'example.com'}])
.servers([{host: 'example.com'}])
.stream().on('data', function(file){
t.ok(file.contents.toString().indexOf('undefined') === -1, 'has no undefined');
t.end();
Expand All @@ -47,7 +47,7 @@ test('ssh empty', function (t) {

test('ssh forwardAgent', function (t) {
dotfiles()
.servers([{host:'example.com', forwardAgent:true}])
.servers([{host: 'example.com', forwardAgent: true}])
.stream().on('data', function(file){
t.ok(file.contents.toString().indexOf('ForwardAgent') > -1, 'has ForwardAgent');
t.end();
Expand All @@ -70,7 +70,7 @@ test('ssh custom', function (t) {
test('ssh proxy', function (t) {
t.plan(1);
dotfiles()
.servers([{host:'example.com'}, {host:'proxy.example.com'}])
.servers([{host: 'example.com'}, {host: 'proxy.example.com'}])
.proxies(function(from, to){
if (to.host === 'example.com')
return 'proxy.example.com';
Expand All @@ -83,7 +83,7 @@ test('ssh proxy', function (t) {
test('ssh proxy does not set from.host', function (t) {
t.plan(1);
dotfiles()
.servers([{host:'example.com'}, {host:'proxy.example.com'}])
.servers([{host: 'example.com'}, {host: 'proxy.example.com'}])
.proxies(function(from){
if (from.host)
t.fail('should not set from.host');
Expand All @@ -96,7 +96,7 @@ test('ssh proxy does not set from.host', function (t) {
test('ssh proxy sets from.host', function (t) {
t.plan(1);
dotfiles()
.servers([{host:'example.com'}, {host:'proxy.example.com'}])
.servers([{host: 'example.com'}, {host: 'proxy.example.com'}])
.proxies(function(from){
if (!from.host)
t.fail('should set from.host');
Expand All @@ -108,7 +108,7 @@ test('ssh proxy sets from.host', function (t) {

test('ssh proxy remote self', function (t) {
dotfiles()
.servers([{host:'example.com'}, {host:'proxy.example.com'}])
.servers([{host: 'example.com'}, {host: 'proxy.example.com'}])
.proxies(function(from, to){
if (to.host === 'example.com')
return 'proxy.example.com';
Expand All @@ -124,7 +124,7 @@ test('ssh check settings types', function (t) {
dotfiles().proxies('foo');
});
t.throws(function(){
dotfiles().servers({host:'example.com'});
dotfiles().servers({host: 'example.com'});
});
t.throws(function(){
dotfiles().ssh(35);
Expand Down
2 changes: 1 addition & 1 deletion test/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('stream ends', function (t) {
var s = dotfiles()
.bash(__dirname + '/fixtures/bash/*.sh')
.ssh('foo')
.servers([{host:'example.com', port: 3133}])
.servers([{host: 'example.com', port: 3133}])
.stream();

var fileCount = 0;
Expand Down

0 comments on commit 56395c1

Please sign in to comment.