Fix new linting errors

This commit is contained in:
Jeroen Engels 2016-05-05 16:27:26 +02:00
parent 1103f72281
commit afb8f4e287
18 changed files with 23 additions and 24 deletions

2
cli.js
View file

@ -94,7 +94,7 @@ function promptForCommand(argv, cb) {
var questions = [{ var questions = [{
type: 'list', type: 'list',
name: 'command', name: 'command',
message: "What do you want to do?", message: 'What do you want to do?',
choices: [{ choices: [{
name: 'Add a new contributor or add a new contribution type', name: 'Add a new contributor or add a new contribution type',
value: 'add' value: 'add'

View file

@ -22,12 +22,12 @@ function getQuestions(options, username, contributions) {
return [{ return [{
type: 'input', type: 'input',
name: 'username', name: 'username',
message: "What is the contributor's GitHub username?", message: 'What is the contributor\'s GitHub username?',
when: !username when: !username
}, { }, {
type: 'checkbox', type: 'checkbox',
name: 'contributions', name: 'contributions',
message: "What are the contribution types?", message: 'What are the contribution types?',
when: !contributions, when: !contributions,
choices: contributionChoices(options) choices: contributionChoices(options)
}]; }];

View file

@ -1,6 +1,6 @@
import test from 'ava'; import test from 'ava';
import _ from 'lodash/fp'; import _ from 'lodash/fp';
import formatBadge from './formatBadge'; import formatBadge from './format-badge';
test('should return badge with the number of contributors', t => { test('should return badge with the number of contributors', t => {
const options = {}; const options = {};

View file

@ -1,6 +1,6 @@
import test from 'ava'; import test from 'ava';
import contributors from './fixtures/contributors.json'; import contributors from './fixtures/contributors.json';
import formatContributionType from './formatContributionType'; import formatContributionType from './format-contribution-type';
const fixtures = () => { const fixtures = () => {
const options = { const options = {

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var _ = require('lodash/fp'); var _ = require('lodash/fp');
var formatContributionType = require('./formatContributionType'); var formatContributionType = require('./format-contribution-type');
var avatarTemplate = _.template('![<%= contributor.name %>](<%= contributor.avatar_url %>)'); var avatarTemplate = _.template('![<%= contributor.name %>](<%= contributor.avatar_url %>)');
var avatarBlockTemplate = _.template('[<%= avatar %><br /><sub><%= contributor.name %></sub>](<%= contributor.profile %>)'); var avatarBlockTemplate = _.template('[<%= avatar %><br /><sub><%= contributor.name %></sub>](<%= contributor.profile %>)');

View file

@ -1,6 +1,6 @@
import test from 'ava'; import test from 'ava';
import _ from 'lodash/fp'; import _ from 'lodash/fp';
import formatContributor from './formatContributor'; import formatContributor from './format-contributor';
import contributors from './fixtures/contributors.json'; import contributors from './fixtures/contributors.json';
function fixtures() { function fixtures() {

View file

@ -2,10 +2,10 @@
var _ = require('lodash/fp'); var _ = require('lodash/fp');
var injectContentBetween = require('../util').markdown.injectContentBetween; var injectContentBetween = require('../util').markdown.injectContentBetween;
var formatBadge = require('./formatBadge'); var formatBadge = require('./format-badge');
var formatContributor = require('./formatContributor'); var formatContributor = require('./format-contributor');
var badgeRegex = /\[\!\[All Contributors\]\([a-zA-Z0-9\-\.\/_\:\?=]+\)\]\(\#\w+\)/; var badgeRegex = /\[!\[All Contributors\]\([a-zA-Z0-9\-\.\/_:\?=]+\)\]\(#\w+\)/;
function injectListBetweenTags(newContent) { function injectListBetweenTags(newContent) {
return function (previousContent) { return function (previousContent) {

View file

@ -1,5 +1,5 @@
import test from 'ava'; import test from 'ava';
import {addBadge} from './initContent'; import {addBadge} from './init-content';
test('should insert badge under title', t => { test('should insert badge under title', t => {
const content = [ const content = [

View file

@ -1,5 +1,5 @@
import test from 'ava'; import test from 'ava';
import {addContributorsList} from './initContent'; import {addContributorsList} from './init-content';
test('should insert list under contributors section', t => { test('should insert list under contributors section', t => {
const content = [ const content = [

View file

@ -4,7 +4,7 @@ var _ = require('lodash/fp');
var series = require('async/series'); var series = require('async/series');
var util = require('../util'); var util = require('../util');
var prompt = require('./prompt'); var prompt = require('./prompt');
var initContent = require('./initContent'); var initContent = require('./init-content');
var configFile = util.configFile; var configFile = util.configFile;
var markdown = util.markdown; var markdown = util.markdown;

View file

@ -7,11 +7,11 @@ var git = require('../util').git;
var questions = [{ var questions = [{
type: 'input', type: 'input',
name: 'projectName', name: 'projectName',
message: "What's the name of the repository?" message: 'What\'s the name of the repository?'
}, { }, {
type: 'input', type: 'input',
name: 'projectOwner', name: 'projectOwner',
message: "Who is the owner of the repository?" message: 'Who is the owner of the repository?'
}, { }, {
type: 'input', type: 'input',
name: 'contributorFile', name: 'contributorFile',
@ -20,11 +20,11 @@ var questions = [{
}, { }, {
type: 'confirm', type: 'confirm',
name: 'needBadge', name: 'needBadge',
message: "Do you want a badge tallying the number of contributors?" message: 'Do you want a badge tallying the number of contributors?'
}, { }, {
type: 'input', type: 'input',
name: 'badgeFile', name: 'badgeFile',
message: "In which file should the badge be shown?", message: 'In which file should the badge be shown?',
when: function (answers) { when: function (answers) {
return answers.needBadge; return answers.needBadge;
}, },
@ -34,13 +34,13 @@ var questions = [{
}, { }, {
type: 'input', type: 'input',
name: 'imageSize', name: 'imageSize',
message: "How big should the avatars be? (in px)", message: 'How big should the avatars be? (in px)',
filter: parseInt, filter: parseInt,
default: 100 default: 100
}, { }, {
type: 'confirm', type: 'confirm',
name: 'commit', name: 'commit',
message: "Do you want this badge to auto-commit when contributors are added?", message: 'Do you want this badge to auto-commit when contributors are added?',
default: true default: true
}]; }];

View file

@ -1,12 +1,11 @@
'use strict'; 'use strict';
var path = require('path'); var path = require('path');
var spawn = require('child_process').spawn;
var _ = require('lodash/fp'); var _ = require('lodash/fp');
var commitTemplate = '<%= (newContributor ? "Add" : "Update") %> <%= username %> as a contributor'; var commitTemplate = '<%= (newContributor ? "Add" : "Update") %> <%= username %> as a contributor';
var spawn = require('child_process').spawn;
function getRemoteOriginData(cb) { function getRemoteOriginData(cb) {
var output = ''; var output = '';
var git = spawn('git', 'config --get remote.origin.url'.split(' ')); var git = spawn('git', 'config --get remote.origin.url'.split(' '));
@ -21,7 +20,7 @@ function getRemoteOriginData(cb) {
} }
function parse(originUrl) { function parse(originUrl) {
var result = /\:(\w+)\/([A-Za-z0-9-_]+)/.exec(originUrl); var result = /:(\w+)\/([A-Za-z0-9-_]+)/.exec(originUrl);
return { return {
projectOwner: result[1], projectOwner: result[1],
projectName: result[2] projectName: result[2]

View file

@ -1,8 +1,8 @@
'use strict'; 'use strict';
module.exports = { module.exports = {
configFile: require('./configFile'), configFile: require('./config-file'),
contributionTypes: require('./contributionTypes'), contributionTypes: require('./contribution-types'),
git: require('./git'), git: require('./git'),
markdown: require('./markdown') markdown: require('./markdown')
}; };