<commit_before>const markdownlint = require('markdownlint');

const options = {
  files: process.argv.slice(2),
  config: {
    default: false,
    resultVersion: 1,
    'header-increment': true,
    'first-header-h1': true,
    'header-style': true,
    'no-reversed-links': true,
    'no-missing-space-atx': true,
    'no-multiple-space-atx': true,
    'no-duplicate-header': true,
    'single-h1': true,
    'no-trailing-punctuation': true,
    'no-multiple-space-blockquote': true,
    'no-bare-urls': true,
    'no-space-in-emphasis': true,
    'no-space-in-code': true,
    'no-space-in-links': true,
    'no-empty-links': true
  }
};

const result = markdownlint
  .sync(options)
  .toString(true);

console.warn(result);
process.exit(1);
<commit_msg>Log linted files and errors<commit_after>/* eslint-disable  no-console */
const markdownlint = require('markdownlint');

const options = {
  files: process.argv.slice(2),
  config: {
    default: false,
    // resultVersion: 1,
    MD001: true,
    MD002: true,
    MD003: true,
    MD024: true,
    MD025: true
  }
};

console.log('🗒  Linted files:');
process.argv.slice(2).forEach(filePath => console.log(`    📁  ${filePath}`));

markdownlint(options, (err, result) => {
  if (err) {
    console.log('❌ Error running markdownlint');
    process.exit(1);
  }

  if (result.toString() === '') {
    process.exit(0);
  }

  console.log('\n❌  Errors:');
  result
    .toString(true)
    .split('\n')
    .forEach(error => console.log(`    ${error}`));
  process.exit(1);
});

{'fraction_non_alphanumeric': 0.18419333768778576, 'fraction_numerical': 0.016982364467668192, 'mean_word_length': 3.185792349726776, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1728790', 'n_tokens_mistral': 578, 'n_tokens_neox': 563, 'n_words': 107}