<commit_before>#!/usr/bin/env python2

import sys
import yaml


def main(files):
    for f in files:
        try:
            yaml.safe_load(file(f))
        except yaml.reader.ReaderError:
            print "File: %s contains errors" % f
            continue
        except yaml.parser.ParserError:
            print "File: %s parse errors" % f
            continue

if __name__ == '__main__':
    files = sys.stdin.readline()
    filelist = files.split()
    main(filelist)<commit_msg>Linting<commit_after>#!/usr/bin/env python2
"""Simple syntax checker for yaml."""

import sys
import yaml

# FLAGS
exit_code = 0


def main(files):
    """Looping thru a list of files and tries to load em."""
    for f in files:
        try:
            yaml.safe_load(file(f))
        except yaml.reader.ReaderError:
            print "File: %s contains errors" % f
            continue
        except yaml.parser.ParserError:
            print "File: %s parse errors" % f
            exit_code = 1
            continue
    sys.exit(exit_code)


if __name__ == '__main__':
    files = sys.stdin.readline()
    filelist = files.split()
    main(filelist)
{'fraction_non_alphanumeric': 0.10517090271691498, 'fraction_numerical': 0.0035056967572304996, 'mean_word_length': 2.0948509485094853, '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': '7446978', 'n_tokens_mistral': 366, 'n_tokens_neox': 346, 'n_words': 101}