mirror of
https://github.com/all-contributors/cli.git
synced 2025-01-09 13:36:29 +00:00
Fix new linting errors
This commit is contained in:
parent
1103f72281
commit
afb8f4e287
18 changed files with 23 additions and 24 deletions
2
cli.js
2
cli.js
|
@ -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'
|
||||
|
|
|
@ -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)
|
||||
}];
|
||||
|
|
|
@ -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 = {};
|
|
@ -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 = {
|
|
@ -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 %>)');
|
|
@ -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() {
|
|
@ -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) {
|
||||
|
|
|
@ -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 = [
|
|
@ -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 = [
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
}];
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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')
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue