<commit_before>from __future__ import absolute_import

import fnmatch
import os
import unittest

from . import validate_json_format


class TestSettings(unittest.TestCase):
    def _get_json_files(self, file_pattern, folder='.'):
        for root, dirnames, filenames in os.walk(folder):
            for filename in fnmatch.filter(filenames, file_pattern):
                yield os.path.join(root, filename)
            for dirname in [d for d in dirnames
                            if d not in ('.git', '.tox')]:
                for f in self._get_json_files(
                        file_pattern, os.path.join(root, dirname)):
                    yield f

    def test_json_settings(self):
        """Test each JSON file."""
        file_patterns = (
            '*.sublime-settings',
            '*.sublime-commands',
            '*.sublime-menu',<commit_msg>Add '*.json' file extensions to test pattern list.<commit_after>from __future__ import absolute_import

import fnmatch
import os
import unittest

from . import validate_json_format


class TestSettings(unittest.TestCase):
    def _get_json_files(self, file_pattern, folder='.'):
        for root, dirnames, filenames in os.walk(folder):
            for filename in fnmatch.filter(filenames, file_pattern):
                yield os.path.join(root, filename)
            for dirname in [d for d in dirnames
                            if d not in ('.git', '.tox')]:
                for f in self._get_json_files(
                        file_pattern, os.path.join(root, dirname)):
                    yield f

    def test_json_settings(self):
        """Test each JSON file."""
        file_patterns = (
            '*.sublime-settings',
            '*.sublime-commands',
            '*.sublime-menu',
            '*.json'
{'fraction_non_alphanumeric': 0.10033632286995516, 'fraction_numerical': 0.0, 'mean_word_length': 1.975, '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': '7276550', 'n_tokens_mistral': 505, 'n_tokens_neox': 490, 'n_words': 139}