fix: add links to relevant style guide
This commit is contained in:
committed by
mrugesh mohapatra
parent
dd2b40bfd7
commit
fb121b39d2
@ -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');
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user