<commit_before>#!/bin/bash

mac_names="mooseWarning mooseDeprecated mooseError EFAError EFAWarning mooseInfo"

for i in $(seq 12); do
    for mac in $mac_names; do
        ag -l "$mac"' *\(' . | grep -v 'MooseError' | xargs perl -0777 -i'' -pe 's/('"$mac"' *\(((?!\) ?;).)+? *?) ?<< ?(.+?(?=\) ?;))/\1, \3/igs'
        #grep --recursive -l "$mac"' *(' . | grep -v 'MooseError' | xargs perl -0777 -i'' -pe 's/('"$mac"' *\(((?!\) ?;).)+? *?) ?<< ?(.+?(?=\) ?;))/\1, \3/igs'
    done
done

mac_names="mooseWarning mooseDeprecated mooseError mooseInfo"

for mac in $mac_names; do
    ag -l "$mac" . | grep -v 'MooseError' | xargs sed -i'' -e 's/'"$mac"'\([^a-zA-Z0-9]\)/'"$mac"'2\1/g'
    #grep --recursive -l "$mac" . | grep -v 'MooseError' | xargs sed -i'' -e 's/'"$mac"'\([^a-zA-Z0-9]\)/'"$mac"'2\1/g'
done

#ag -l "$mac" . | grep -v 'MooseError' | xargs perl -0777 -i'' -pe 's/( *\\\?)\n( *),/,\n \2/igs'
<commit_msg>fix script now only renames macros with << operator<commit_after>#!/bin/bash

for i in $(seq 12); do
    ag -l "(moose(Error|Warning|Info|Deprecated)|EFAError|EFAWarning)"'2* *\(' . | grep -v 'MooseError' | xargs perl -0777 -i'' -pe 's/moose((Warning|Error|Deprecated|Info)2*)( *\(((?!\) ?;).)+? *?) ?<< ?(.+?(?=\) ?;))/moose${2}2$3, $5/igs'
done

# fix leading commas to be trailing
#ag -l "moose(Error|Warning|Info|Deprecated)" . | grep -v 'MooseError' | xargs perl -0777 -i'' -pe 's/( *\\\?)\n( *),/,\n \2/igs'

# civet precheck regexp
#'s/moose(Warning|Error|Deprecated|Info)( *\(((?!\) ?;).)+? *?) ?<< ?(.+?(?=\) ?;))/igs'
{'fraction_non_alphanumeric': 0.30375647668393785, 'fraction_numerical': 0.02849740932642487, 'mean_word_length': 3.2445054945054945, 'pattern_counts': {'":': 0, '<': 13, '<?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': '1980635', 'n_tokens_mistral': 737, 'n_tokens_neox': 685, 'n_words': 152}