<commit_before>#!/usr/bin/python

from cases import DtfCase
from utils import expand_tree
from line_length import DtfLineLength
import dtf

class DtfTreeLineLength(DtfLineLength):
    def render_source_tree(self): 
        self.msg('crawling "%s" for files.' % self.case['directory'])

        output = [ item for item 
                        in expand_tree(self.case['directory'], self.case['extension'])
                        if item not in self.case['exceptions']
                ]

        return output

    def check_directory(self, p=None):
        for source_file in self.render_source_tree():
            result = self.check_file(source_file)

            if result[0] is False: 
                failing = source_file
                break
            else:<commit_msg>minor: formatting<commit_after>#!/usr/bin/python

from cases import DtfCase
from utils import expand_tree
from line_length import DtfLineLength
import dtf

class DtfTreeLineLength(DtfLineLength):
    def render_source_tree(self): 
        self.msg('crawling "%s" for files.' % self.case['directory'])

        output = [ item for item
                        in expand_tree(self.case['directory'], self.case['extension'])
                        if item not in self.case['exceptions'] ]

        return output

    def check_directory(self, p=None):
        for source_file in self.render_source_tree():
            result = self.check_file(source_file)

            if result[0] is False: 
                failing = source_file
                break
            else:
{'fraction_non_alphanumeric': 0.08844415752098128, 'fraction_numerical': 0.0012911555842479018, 'mean_word_length': 2.1697341513292434, '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': '2727296', 'n_tokens_mistral': 435, 'n_tokens_neox': 412, 'n_words': 110}