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 = [{
type: 'list',
name: 'command',
message: "What do you want to do?",
message: 'What do you want to do?',
choices: [{
name: 'Add a new contributor or add a new contribution type',
value: 'add'

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,10 +2,10 @@
var _ = require('lodash/fp');
var injectContentBetween = require('../util').markdown.injectContentBetween;
var formatBadge = require('./formatBadge');
var formatContributor = require('./formatContributor');
var formatBadge = require('./format-badge');
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) {
return function (previousContent) {

View file

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

View file

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

View file

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

View file

@ -7,11 +7,11 @@ var git = require('../util').git;
var questions = [{
type: 'input',
name: 'projectName',
message: "What's the name of the repository?"
message: 'What\'s the name of the repository?'
}, {
type: 'input',
name: 'projectOwner',
message: "Who is the owner of the repository?"
message: 'Who is the owner of the repository?'
}, {
type: 'input',
name: 'contributorFile',
@ -20,11 +20,11 @@ var questions = [{
}, {
type: 'confirm',
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',
name: 'badgeFile',
message: "In which file should the badge be shown?",
message: 'In which file should the badge be shown?',
when: function (answers) {
return answers.needBadge;
},
@ -34,13 +34,13 @@ var questions = [{
}, {
type: 'input',
name: 'imageSize',
message: "How big should the avatars be? (in px)",
message: 'How big should the avatars be? (in px)',
filter: parseInt,
default: 100
}, {
type: 'confirm',
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
}];

View file

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

View file

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