fix: add links to relevant style guide

This commit is contained in:
Mrugesh Mohapatra
2018-11-22 01:19:02 +05:30
committed by mrugesh mohapatra
parent dd2b40bfd7
commit fb121b39d2
3 changed files with 5 additions and 4 deletions

View File

@ -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');

View File

@ -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;

View File

@ -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
});
}