How to use the danger-plugin-toolbox.commonFileWarnings function in danger-plugin-toolbox

To help you get started, we’ve selected a few danger-plugin-toolbox examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Skyscanner / backpack / dangerfile.js View on Github external
markdownChanges.forEach(path => {
  const fileContent = fs.readFileSync(path);

  fileContent
    .toString()
    .split(/\r?\n/)
    .forEach((line, lineIndex) => {
      AVOID_EXACT_WORDS.forEach(phrase => {
        if (line.includes(phrase.word)) {
          warn(`${phrase.reason} on line ${lineIndex + 1} in ${path}`);
        }
      });
    });
});

commonFileWarnings('test.log', {
  msg:
    'The build logs contain these warnings (check the build output in Travis for more details):',
});

danger-plugin-toolbox

Danger Plugin Toolbox is a Danger JS plugin containing a set of common validations and utilities, build to make it easy to start using Danger JS.

MIT
Latest version published 1 month ago

Package Health Score

72 / 100
Full package analysis