<commit_before>#!/bin/bash
TEMPFILE="/tmp/css-find-garbage"
rm -f $TEMPFILE
find ../core -maxdepth 2 | xargs -I {} bash -c "echo {}; ls {} -1a | wc -l" | grep -x "3" -B1 | grep "/" > $TEMPFILE
find ../applications -maxdepth 2 | xargs -I {} bash -c "echo {}; ls {} -1a | wc -l" | grep -x "3" -B1 | grep "/" >> $TEMPFILE

BROKENPLUGINS=`wc -l < $TEMPFILE`
if [[ $BROKENPLUGINS == "0" ]]
then
rm -f $TEMPFILE
exit 0
else
echo Found plug-ins with just one file/directory:
cat $TEMPFILE
rm -f $TEMPFILE
exit -1
fi
<commit_msg>build: added products dir scanner for broken plugins and check for .project artifacts<commit_after>#!/bin/bash
TEMPFILE="/tmp/css-find-garbage"
rm -f $TEMPFILE

find ../core -maxdepth 2 | xargs -I {} bash -c "echo {}; ls {} -1a | wc -l" | grep -x "3" -B1 | grep "/" > $TEMPFILE
find ../applications -maxdepth 2 | xargs -I {} bash -c "echo {}; ls {} -1a | wc -l" | grep -x "3" -B1 | grep "/" >> $TEMPFILE
find ../products -maxdepth 3 | xargs -I {} bash -c "echo {}; ls {} -1a | wc -l" | grep -x "3" -B1 | grep "/" >> $TEMPFILE

BROKENPLUGINS=`wc -l < $TEMPFILE`
error=0
if [[ $BROKENPLUGINS != "0" ]]
  then
    echo Found plug-ins with just one file/directory:
	cat $TEMPFILE

	echo "Now scan these dirs for .project artifacts."
    while read line
    do	
      name=$(find $line -maxdepth 1 -type f -name ".project")
	  if [[ "$name" != "" ]]
         then 
		   error=-1
		   echo ".project artifact found in $line"
      fi
    done <$TEMPFILE
fi

rm -f $TEMPFILE
exit $error
{'fraction_non_alphanumeric': 0.17866666666666667, 'fraction_numerical': 0.018, 'mean_word_length': 2.687960687960688, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 11, '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': '4586371', 'n_tokens_mistral': 613, 'n_tokens_neox': 581, 'n_words': 201}