<commit_before>const generate = require('babel-generator').default;

module.exports = function({types: t}) {
  return {
    name: 'assert-messages',
    visitor: {
      CallExpression(path, state) {
        // assuming `assert.something(arg1, arg2)`

        // assert.something
        const callee = path.node.callee;
        if (!t.isMemberExpression(callee)) { return; }

        if (!t.isIdentifier(callee.object, {name: 'assert'})) { return; }
        if (!t.isIdentifier(callee.property)) { return; }

        try {
          const code = generate(path.node).code;
          path.node.arguments.push(t.stringLiteral(code));
        } catch (err) {
          // nothing
        }
      },
    },
  };
};<commit_msg>Don't add an argument to assert.isRejected() calls<commit_after>const generate = require('babel-generator').default;

module.exports = function({types: t}) {
  return {
    name: 'assert-messages',
    visitor: {
      CallExpression(path, state) {
        // assuming `assert.something(arg1, arg2)`

        // assert.something
        const callee = path.node.callee;
        if (!t.isMemberExpression(callee)) { return; }

        if (!t.isIdentifier(callee.object, {name: 'assert'})) { return; }
        if (t.isIdentifier(callee.property, {name: 'isRejected'})) { return; }
        if (!t.isIdentifier(callee.property)) { return; }

        try {
          const code = generate(path.node).code;
          path.node.arguments.push(t.stringLiteral(code));
        } catch (err) {
          // nothing
        }
      },
    },
  };
};
{'fraction_non_alphanumeric': 0.15576923076923077, 'fraction_numerical': 0.002564102564102564, 'mean_word_length': 2.342612419700214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2067388', 'n_tokens_mistral': 481, 'n_tokens_neox': 471, 'n_words': 87}