Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Removed validation build step
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Goldberg committed Nov 5, 2018
1 parent d693a7a commit ca0a5a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
16 changes: 0 additions & 16 deletions build-tasks/common/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,7 @@ function getContribRuleNames() {
.sort();
}

function getAllFormatterNames() {
const convertToFormatterNames = filename => {
filename = filename
.replace(/Formatter\..*/, '') // file extension plus Formatter suffix
.replace(/.*\//, ''); // leading path

return kebabCase(filename);
};

const formatters = glob.sync('src/*Formatter.ts').map(convertToFormatterNames);
formatters.sort();

return formatters;
}

module.exports = {
getAllFormatterNames,
getContribRuleNames,
getAllRules,
getMetadataFromFile,
Expand Down
12 changes: 2 additions & 10 deletions build-tasks/validate-documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
*/

const { yellowBright } = require('chalk');
const { readFile, readJSON } = require('./common/files');
const { getAllFormatterNames, getContribRuleNames } = require('./common/meta');
const { readFile } = require('./common/files');
const { getContribRuleNames } = require('./common/meta');

const readmeText = readFile('README.md');
const packageJson = readJSON('package.json');
const validationErrors = [];

getContribRuleNames().forEach(ruleName => {
Expand All @@ -17,13 +16,6 @@ getContribRuleNames().forEach(ruleName => {
}
});

getAllFormatterNames().forEach(formatterName => {
if (readmeText.indexOf(formatterName) === -1) {
validationErrors.push('A formatter was found that is not documented in README.md: ' + formatterName);
validationFailed = true;
}
});

if (validationErrors.length > 0) {
console.log(yellowBright(validationErrors.join('\n')));
process.exit(1);
Expand Down

0 comments on commit ca0a5a2

Please sign in to comment.