From fb121b39d2723cc2c2b3aae53f467f06bf5c02a4 Mon Sep 17 00:00:00 2001 From: Mrugesh Mohapatra Date: Thu, 22 Nov 2018 01:19:02 +0530 Subject: [PATCH] fix: add links to relevant style guide --- one-off-scripts/addcommentOnFrontmatterIssues.js | 2 +- validation/guideFolderChecks/createErrorMsg.js | 2 +- validation/guideFolderChecks/frontmatterCheck.js | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/one-off-scripts/addcommentOnFrontmatterIssues.js b/one-off-scripts/addcommentOnFrontmatterIssues.js index 9053052f85..b4eb30f8dc 100644 --- a/one-off-scripts/addcommentOnFrontmatterIssues.js +++ b/one-off-scripts/addcommentOnFrontmatterIssues.js @@ -12,7 +12,7 @@ const { owner, repo, octokitConfig, octokitAuth } = require('../constants'); const octokit = require('@octokit/rest')(octokitConfig); const { getPRs, getUserInput } = require('../getPRs'); -const { addLabels } = require('../prTasks'); +const { addLabels, addComment } = require('../prTasks'); const { rateLimiter, savePrData, ProcessingLog } = require('../utils'); const { frontmatterCheck } = require('../validation/guideFolderChecks/frontmatterCheck'); const { createErrorMsg } = require('../validation/guideFolderChecks/createErrorMsg'); diff --git a/validation/guideFolderChecks/createErrorMsg.js b/validation/guideFolderChecks/createErrorMsg.js index 1f54d279f3..4cda58ba1b 100644 --- a/validation/guideFolderChecks/createErrorMsg.js +++ b/validation/guideFolderChecks/createErrorMsg.js @@ -19,7 +19,7 @@ const createErrorMsg = (errors, user) => { }, ""); let errorMsgFooter = dedent` - P.S: I am just friendly bot. You should reach out to the [Contributors Chat room](https://gitter.im/FreeCodeCamp/Contributors) for more help. + P.S: I am just friendly bot. Review our [Guidelines for Contributing](https://github.com/FreeCodeCamp/FreeCodeCamp/blob/master/CONTRIBUTING.md) and reach out to the [Contributors Chat room](https://gitter.im/FreeCodeCamp/Contributors) for more help. `; return errorMsgHeader + errorMsgTable + "\n\n" + errorMsgFooter; diff --git a/validation/guideFolderChecks/frontmatterCheck.js b/validation/guideFolderChecks/frontmatterCheck.js index fe2b27e1f3..e344991c6b 100644 --- a/validation/guideFolderChecks/frontmatterCheck.js +++ b/validation/guideFolderChecks/frontmatterCheck.js @@ -1,18 +1,19 @@ const matter = require('gray-matter'); const _ = require('lodash'); +const dedent = require('dedent'); const frontmatterCheck = (fullPath, isTranslation, fileContent) => { const { data: frontmatter } = matter(fileContent); let errors = []; if (!frontmatter || _.isEmpty(frontmatter) || !frontmatter.title) { errors.push({ - msg: `Misplaced frontmatter or missing \`title key\` frontmatter.`, + msg: `Misplaced or missing \`title\` keyword in the front matter block. Review the [style guide](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/style-guide-for-guide-articles.md#title) for more details.`, fullPath }); } if (isTranslation && !frontmatter.localeTitle) { errors.push({ - msg: `Missing \`localeTitle key\`frontmatter.`, + msg: `Missing \`localeTitle\` keyword in the front matter block. Review the [style guide](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/docs/style-guide-for-guide-articles.md#title) for more details.`, fullPath }); }