mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-26 14:36:26 +00:00
Update dependency prettier to version 1.3.0 (#198)
* Update dependency prettier to version 1.3.0 * Run eslint-fix
This commit is contained in:
parent
2747b1e172
commit
c56c6d9bbe
9 changed files with 22 additions and 47 deletions
|
@ -31,8 +31,6 @@ options.forEach(option => {
|
||||||
if (cliName.length) {
|
if (cliName.length) {
|
||||||
cliName = `\`${cliName}\``;
|
cliName = `\`${cliName}\``;
|
||||||
}
|
}
|
||||||
console.log(
|
console.log(`| \`${option.name}\` | ${option.description} | ${option.type} | ${optionDefault} | ${envName} | ${cliName} |`);
|
||||||
`| \`${option.name}\` | ${option.description} | ${option.type} | ${optionDefault} | ${envName} | ${cliName} |`
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
|
|
|
@ -88,9 +88,7 @@ async function initRepo(repoName, token, endpoint) {
|
||||||
|
|
||||||
// Returns an array of file paths in current repo matching the fileName
|
// Returns an array of file paths in current repo matching the fileName
|
||||||
async function findFilePaths(fileName) {
|
async function findFilePaths(fileName) {
|
||||||
const res = await ghGot(
|
const res = await ghGot(`search/code?q=repo:${config.repoName}+filename:${fileName}`);
|
||||||
`search/code?q=repo:${config.repoName}+filename:${fileName}`
|
|
||||||
);
|
|
||||||
const exactMatches = res.body.items.filter(item => item.name === fileName);
|
const exactMatches = res.body.items.filter(item => item.name === fileName);
|
||||||
|
|
||||||
// GitHub seems to return files in the root with a leading `/`
|
// GitHub seems to return files in the root with a leading `/`
|
||||||
|
@ -104,9 +102,7 @@ async function findFilePaths(fileName) {
|
||||||
async function branchExists(branchName) {
|
async function branchExists(branchName) {
|
||||||
logger.debug(`Checking if branch exists: ${branchName}`);
|
logger.debug(`Checking if branch exists: ${branchName}`);
|
||||||
try {
|
try {
|
||||||
const res = await ghGot(
|
const res = await ghGot(`repos/${config.repoName}/git/refs/heads/${branchName}`);
|
||||||
`repos/${config.repoName}/git/refs/heads/${branchName}`
|
|
||||||
);
|
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
logger.debug(JSON.stringify(res.body));
|
logger.debug(JSON.stringify(res.body));
|
||||||
if (Array.isArray(res.body)) {
|
if (Array.isArray(res.body)) {
|
||||||
|
@ -257,9 +253,8 @@ async function getPr(prNo) {
|
||||||
} else {
|
} else {
|
||||||
// Check if only one author of all commits
|
// Check if only one author of all commits
|
||||||
logger.debug('Checking all commits');
|
logger.debug('Checking all commits');
|
||||||
const prCommits = (await ghGot(
|
const prCommits = (await ghGot(`repos/${config.repoName}/pulls/${prNo}/commits`))
|
||||||
`repos/${config.repoName}/pulls/${prNo}/commits`
|
.body;
|
||||||
)).body;
|
|
||||||
const authors = prCommits.reduce((arr, commit) => {
|
const authors = prCommits.reduce((arr, commit) => {
|
||||||
const author = commit.author.login;
|
const author = commit.author.login;
|
||||||
if (arr.indexOf(author) === -1) {
|
if (arr.indexOf(author) === -1) {
|
||||||
|
@ -298,9 +293,7 @@ async function mergePr(pr) {
|
||||||
// Generic File operations
|
// Generic File operations
|
||||||
|
|
||||||
async function getFile(filePath, branchName = config.defaultBranch) {
|
async function getFile(filePath, branchName = config.defaultBranch) {
|
||||||
const res = await ghGot(
|
const res = await ghGot(`repos/${config.repoName}/contents/${filePath}?ref=${branchName}`);
|
||||||
`repos/${config.repoName}/contents/${filePath}?ref=${branchName}`
|
|
||||||
);
|
|
||||||
return res.body.content;
|
return res.body.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,9 +322,7 @@ async function commitFilesToBranch(
|
||||||
message,
|
message,
|
||||||
parentBranch = config.defaultBranch
|
parentBranch = config.defaultBranch
|
||||||
) {
|
) {
|
||||||
logger.debug(
|
logger.debug(`commitFilesToBranch('${branchName}', files, message, '${parentBranch})'`);
|
||||||
`commitFilesToBranch('${branchName}', files, message, '${parentBranch})'`
|
|
||||||
);
|
|
||||||
const parentCommit = await getBranchCommit(parentBranch);
|
const parentCommit = await getBranchCommit(parentBranch);
|
||||||
const parentTree = await getCommitTree(parentCommit);
|
const parentTree = await getCommitTree(parentCommit);
|
||||||
const fileBlobs = [];
|
const fileBlobs = [];
|
||||||
|
|
|
@ -275,9 +275,7 @@ async function mergePr(pr) {
|
||||||
// Generic File operations
|
// Generic File operations
|
||||||
|
|
||||||
async function getFile(filePath, branchName = config.defaultBranch) {
|
async function getFile(filePath, branchName = config.defaultBranch) {
|
||||||
const res = await glGot(
|
const res = await glGot(`projects/${config.repoName}/repository/files?file_path=${filePath}&ref=${branchName}`);
|
||||||
`projects/${config.repoName}/repository/files?file_path=${filePath}&ref=${branchName}`
|
|
||||||
);
|
|
||||||
return res.body.content;
|
return res.body.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,9 +338,7 @@ async function commitFilesToBranch(
|
||||||
message,
|
message,
|
||||||
parentBranch = config.defaultBranch
|
parentBranch = config.defaultBranch
|
||||||
) {
|
) {
|
||||||
logger.debug(
|
logger.debug(`commitFilesToBranch('${branchName}', files, message, '${parentBranch})'`);
|
||||||
`commitFilesToBranch('${branchName}', files, message, '${parentBranch})'`
|
|
||||||
);
|
|
||||||
if (branchName !== parentBranch) {
|
if (branchName !== parentBranch) {
|
||||||
const isBranchExisting = await branchExists(branchName);
|
const isBranchExisting = await branchExists(branchName);
|
||||||
if (isBranchExisting) {
|
if (isBranchExisting) {
|
||||||
|
|
|
@ -39,9 +39,7 @@ async function processRepo(repo) {
|
||||||
} else if (config.platform === 'gitlab') {
|
} else if (config.platform === 'gitlab') {
|
||||||
api = gitlabApi;
|
api = gitlabApi;
|
||||||
} else {
|
} else {
|
||||||
logger.error(
|
logger.error(`Unknown platform ${config.platform} for repository ${repo.repository}`);
|
||||||
`Unknown platform ${config.platform} for repository ${repo.repository}`
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logger.debug(`Processing repository: ${stringify(config)}`);
|
logger.debug(`Processing repository: ${stringify(config)}`);
|
||||||
|
|
|
@ -29,9 +29,7 @@ async function processPackageFile(repoName, packageFile, packageConfig) {
|
||||||
const packageContent = await config.api.getFileJson(packageFile);
|
const packageContent = await config.api.getFileJson(packageFile);
|
||||||
// Check for renovate config inside the package.json
|
// Check for renovate config inside the package.json
|
||||||
if (packageContent.renovate) {
|
if (packageContent.renovate) {
|
||||||
logger.debug(
|
logger.debug(`package.json>renovate config: ${stringify(packageContent.renovate)}`);
|
||||||
`package.json>renovate config: ${stringify(packageContent.renovate)}`
|
|
||||||
);
|
|
||||||
Object.assign(config, packageContent.renovate, { repoConfigured: true });
|
Object.assign(config, packageContent.renovate, { repoConfigured: true });
|
||||||
}
|
}
|
||||||
// Now check if config is disabled
|
// Now check if config is disabled
|
||||||
|
@ -212,9 +210,7 @@ async function updateBranch(upgrades) {
|
||||||
!upgrade0.recreateClosed &&
|
!upgrade0.recreateClosed &&
|
||||||
(await upgrade0.api.checkForClosedPr(branchName, prTitle))
|
(await upgrade0.api.checkForClosedPr(branchName, prTitle))
|
||||||
) {
|
) {
|
||||||
logger.verbose(
|
logger.verbose(`Skipping ${branchName} upgrade as matching closed PR already existed`);
|
||||||
`Skipping ${branchName} upgrade as matching closed PR already existed`
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const branchCreated = await branchWorker.ensureBranch(upgrades);
|
const branchCreated = await branchWorker.ensureBranch(upgrades);
|
||||||
|
|
|
@ -97,9 +97,7 @@ async function ensureBranch(upgrades) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Object.keys(packageFiles).length > 0) {
|
if (Object.keys(packageFiles).length > 0) {
|
||||||
logger.debug(
|
logger.debug(`${Object.keys(packageFiles).length} package file(s) need updating.`);
|
||||||
`${Object.keys(packageFiles).length} package file(s) need updating.`
|
|
||||||
);
|
|
||||||
for (const packageFile of Object.keys(packageFiles)) {
|
for (const packageFile of Object.keys(packageFiles)) {
|
||||||
logger.debug(`Adding ${packageFile}`);
|
logger.debug(`Adding ${packageFile}`);
|
||||||
commitFiles.push({
|
commitFiles.push({
|
||||||
|
|
|
@ -72,9 +72,7 @@ async function ensurePr(upgradeConfig) {
|
||||||
await config.api.addReviewers(pr.number, config.reviewers);
|
await config.api.addReviewers(pr.number, config.reviewers);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.debug(
|
logger.debug(`Skipping assignees and reviewers as automerge=${config.automerge}`);
|
||||||
`Skipping assignees and reviewers as automerge=${config.automerge}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
logger.info(`Created ${pr.displayNumber}`);
|
logger.info(`Created ${pr.displayNumber}`);
|
||||||
return pr;
|
return pr;
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
"eslint-plugin-promise": "3.5.0",
|
"eslint-plugin-promise": "3.5.0",
|
||||||
"mkdirp": "0.5.1",
|
"mkdirp": "0.5.1",
|
||||||
"np": "2.14.1",
|
"np": "2.14.1",
|
||||||
"prettier": "1.2.2",
|
"prettier": "1.3.0",
|
||||||
"rimraf": "2.6.1"
|
"rimraf": "2.6.1"
|
||||||
},
|
},
|
||||||
"babel": {
|
"babel": {
|
||||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -1290,9 +1290,9 @@ flat-cache@^1.2.1:
|
||||||
graceful-fs "^4.1.2"
|
graceful-fs "^4.1.2"
|
||||||
write "^0.2.1"
|
write "^0.2.1"
|
||||||
|
|
||||||
flow-parser@0.43.0:
|
flow-parser@0.45.0:
|
||||||
version "0.43.0"
|
version "0.45.0"
|
||||||
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7"
|
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.45.0.tgz#aa29d4ae27f06aa02817772bba0fcbefef7e62f0"
|
||||||
|
|
||||||
for-in@^1.0.1:
|
for-in@^1.0.1:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
|
@ -2780,16 +2780,16 @@ preserve@^0.2.0:
|
||||||
version "0.2.0"
|
version "0.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||||
|
|
||||||
prettier@1.2.2:
|
prettier@1.3.0:
|
||||||
version "1.2.2"
|
version "1.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.2.tgz#22d17c1132faaaea1f1d4faea31f19f7a1959f3e"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.3.0.tgz#cb02314f1ae2a99e951c17acb77a4096a1060ac2"
|
||||||
dependencies:
|
dependencies:
|
||||||
ast-types "0.9.8"
|
ast-types "0.9.8"
|
||||||
babel-code-frame "6.22.0"
|
babel-code-frame "6.22.0"
|
||||||
babylon "7.0.0-beta.8"
|
babylon "7.0.0-beta.8"
|
||||||
chalk "1.1.3"
|
chalk "1.1.3"
|
||||||
esutils "2.0.2"
|
esutils "2.0.2"
|
||||||
flow-parser "0.43.0"
|
flow-parser "0.45.0"
|
||||||
get-stdin "5.0.1"
|
get-stdin "5.0.1"
|
||||||
glob "7.1.1"
|
glob "7.1.1"
|
||||||
jest-validate "19.0.0"
|
jest-validate "19.0.0"
|
||||||
|
|
Loading…
Reference in a new issue