diff --git a/bin/update-configuration-table.js b/bin/update-configuration-table.js index a39f18733303b31b292d5200be9de205084a1947..a1b342392ac79497b62c4ffd44f80c83712d02ec 100644 --- a/bin/update-configuration-table.js +++ b/bin/update-configuration-table.js @@ -31,6 +31,8 @@ options.forEach(option => { if (cliName.length) { cliName = `\`${cliName}\``; } - console.log(`| \`${option.name}\` | ${option.description} | ${option.type} | ${optionDefault} | ${envName} | ${cliName} |`); + console.log( + `| \`${option.name}\` | ${option.description} | ${option.type} | ${optionDefault} | ${envName} | ${cliName} |` + ); }); /* eslint-enable no-console */ diff --git a/lib/api/github.js b/lib/api/github.js index 8c4bb63032f8d85d46a5e77545b7ca89c7cd4f41..abcdf7a4f8914291df06d0d4d66e84741b502a84 100644 --- a/lib/api/github.js +++ b/lib/api/github.js @@ -88,7 +88,9 @@ async function initRepo(repoName, token, endpoint) { // Returns an array of file paths in current repo matching the fileName async function findFilePaths(fileName) { - const res = await ghGot(`search/code?q=repo:${config.repoName}+filename:${fileName}`); + const res = await ghGot( + `search/code?q=repo:${config.repoName}+filename:${fileName}` + ); const exactMatches = res.body.items.filter(item => item.name === fileName); // GitHub seems to return files in the root with a leading `/` @@ -102,7 +104,9 @@ async function findFilePaths(fileName) { async function branchExists(branchName) { logger.debug(`Checking if branch exists: ${branchName}`); try { - const res = await ghGot(`repos/${config.repoName}/git/refs/heads/${branchName}`); + const res = await ghGot( + `repos/${config.repoName}/git/refs/heads/${branchName}` + ); if (res.statusCode === 200) { logger.debug(JSON.stringify(res.body)); if (Array.isArray(res.body)) { @@ -253,8 +257,9 @@ async function getPr(prNo) { } else { // Check if only one author of all commits logger.debug('Checking all commits'); - const prCommits = (await ghGot(`repos/${config.repoName}/pulls/${prNo}/commits`)) - .body; + const prCommits = (await ghGot( + `repos/${config.repoName}/pulls/${prNo}/commits` + )).body; const authors = prCommits.reduce((arr, commit) => { const author = commit.author.login; if (arr.indexOf(author) === -1) { @@ -293,7 +298,9 @@ async function mergePr(pr) { // Generic File operations async function getFile(filePath, branchName = config.defaultBranch) { - const res = await ghGot(`repos/${config.repoName}/contents/${filePath}?ref=${branchName}`); + const res = await ghGot( + `repos/${config.repoName}/contents/${filePath}?ref=${branchName}` + ); return res.body.content; } @@ -322,7 +329,9 @@ async function commitFilesToBranch( message, parentBranch = config.defaultBranch ) { - logger.debug(`commitFilesToBranch('${branchName}', files, message, '${parentBranch})'`); + logger.debug( + `commitFilesToBranch('${branchName}', files, message, '${parentBranch})'` + ); const parentCommit = await getBranchCommit(parentBranch); const parentTree = await getCommitTree(parentCommit); const fileBlobs = []; diff --git a/lib/api/gitlab.js b/lib/api/gitlab.js index 48bf5a0bd84c444d39d2cc055df21f0dd8e5ff02..859f5f1fe8bdec646e31aae9119bd59379944fd7 100644 --- a/lib/api/gitlab.js +++ b/lib/api/gitlab.js @@ -275,7 +275,9 @@ async function mergePr(pr) { // Generic File operations async function getFile(filePath, branchName = config.defaultBranch) { - const res = await glGot(`projects/${config.repoName}/repository/files?file_path=${filePath}&ref=${branchName}`); + const res = await glGot( + `projects/${config.repoName}/repository/files?file_path=${filePath}&ref=${branchName}` + ); return res.body.content; } @@ -338,7 +340,9 @@ async function commitFilesToBranch( message, parentBranch = config.defaultBranch ) { - logger.debug(`commitFilesToBranch('${branchName}', files, message, '${parentBranch})'`); + logger.debug( + `commitFilesToBranch('${branchName}', files, message, '${parentBranch})'` + ); if (branchName !== parentBranch) { const isBranchExisting = await branchExists(branchName); if (isBranchExisting) { diff --git a/lib/index.js b/lib/index.js index b4892bb14e61a1450022e4b03e243a27a9bdecf2..5bc1228e7a5443da5fe11279957dcc354b2aa500 100644 --- a/lib/index.js +++ b/lib/index.js @@ -39,7 +39,9 @@ async function processRepo(repo) { } else if (config.platform === 'gitlab') { api = gitlabApi; } else { - logger.error(`Unknown platform ${config.platform} for repository ${repo.repository}`); + logger.error( + `Unknown platform ${config.platform} for repository ${repo.repository}` + ); return; } logger.debug(`Processing repository: ${stringify(config)}`); diff --git a/lib/worker.js b/lib/worker.js index 9eafbb338b206dfd0835467162dc12a4b768dd26..917276da7f04775716afefe0542ecfaaf83051c8 100644 --- a/lib/worker.js +++ b/lib/worker.js @@ -29,7 +29,9 @@ async function processPackageFile(repoName, packageFile, packageConfig) { const packageContent = await config.api.getFileJson(packageFile); // Check for renovate config inside the package.json if (packageContent.renovate) { - logger.debug(`package.json>renovate config: ${stringify(packageContent.renovate)}`); + logger.debug( + `package.json>renovate config: ${stringify(packageContent.renovate)}` + ); Object.assign(config, packageContent.renovate, { repoConfigured: true }); } // Now check if config is disabled @@ -211,7 +213,9 @@ async function updateBranch(upgrades) { !upgrade0.recreateClosed && (await upgrade0.api.checkForClosedPr(branchName, prTitle)) ) { - logger.verbose(`Skipping ${branchName} upgrade as matching closed PR already existed`); + logger.verbose( + `Skipping ${branchName} upgrade as matching closed PR already existed` + ); return; } const branchCreated = await branchWorker.ensureBranch(upgrades); diff --git a/lib/workers/branch.js b/lib/workers/branch.js index 104cc63b1d1ed31cc2cffa4ff3d699b455d1d9ef..509074048ba70c5fd819aba4631f9312b595f0e5 100644 --- a/lib/workers/branch.js +++ b/lib/workers/branch.js @@ -97,7 +97,9 @@ async function ensureBranch(upgrades) { } } if (Object.keys(packageFiles).length > 0) { - logger.debug(`${Object.keys(packageFiles).length} package file(s) need updating.`); + logger.debug( + `${Object.keys(packageFiles).length} package file(s) need updating.` + ); for (const packageFile of Object.keys(packageFiles)) { logger.debug(`Adding ${packageFile}`); commitFiles.push({ diff --git a/lib/workers/pr.js b/lib/workers/pr.js index 3f60f35faad180baded0e340e38e72145815565c..b381106def0087d84c8c75712ad3b5a0d93888ca 100644 --- a/lib/workers/pr.js +++ b/lib/workers/pr.js @@ -72,7 +72,9 @@ async function ensurePr(upgradeConfig) { await config.api.addReviewers(pr.number, config.reviewers); } } else { - logger.debug(`Skipping assignees and reviewers as automerge=${config.automerge}`); + logger.debug( + `Skipping assignees and reviewers as automerge=${config.automerge}` + ); } logger.info(`Created ${pr.displayNumber}`); return pr; diff --git a/package.json b/package.json index 8c6b32b5b942efd329a6ab5c7824b4aad835c817..4b9d61877620d653231148e5c8260703682a4ea7 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "eslint-plugin-promise": "3.5.0", "mkdirp": "0.5.1", "np": "2.14.1", - "prettier": "1.3.0", + "prettier": "1.3.1", "rimraf": "2.6.1" }, "babel": { diff --git a/yarn.lock b/yarn.lock index 7c94c055f1bbb36f4a1701cb2d8f4079fcf52bdb..5f7c01e908443b0b13cae7f15c639f7eb7e7a124 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2799,9 +2799,9 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.3.0.tgz#cb02314f1ae2a99e951c17acb77a4096a1060ac2" +prettier@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.3.1.tgz#fa0ea84b45ac0ba6de6a1e4cecdcff900d563151" dependencies: ast-types "0.9.8" babel-code-frame "6.22.0"