<commit_before>#!/usr/bin/env python
# xctest_checker/main.py - Entry point for xctest_checker -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors

from __future__ import absolute_import

import argparse

from . import compare


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('actual', help='A path to a file containing the '
                                       'actual output of an XCTest run.')
    parser.add_argument('expected', help='A path to a file containing the '
                                         'expected output of an XCTest run.')
    parser.add_argument('-p', '--check-prefix',
                        default='// CHECK:',
                        help='{prog} checks actual output against expected '
                             'output. By default, {prog} only checks lines '
                             'that are prefixed with "// CHECK:". This '
                             'option can be used to change that '
                             'prefix. Leading and trailing whitespace is '
                             'ignored unless the check line contains explicit '
                             '^ or $ characters'.format(prog=parser.prog))
    args = parser.parse_args()
    compare.compare(args.actual, args.expected, args.check_prefix)


if __name__ == '__main__':
    main()<commit_msg>[xctest_checker] Use argparse substitutions<commit_after>#!/usr/bin/env python
# xctest_checker/main.py - Entry point for xctest_checker -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors

from __future__ import absolute_import

import argparse

from . import compare


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('actual', help='A path to a file containing the '
                                       'actual output of an XCTest run.')
    parser.add_argument('expected', help='A path to a file containing the '
                                         'expected output of an XCTest run.')
    parser.add_argument('-p', '--check-prefix',
                        default='// CHECK: ',
                        help='%(prog)s checks actual output against expected '
                             'output. By default, %(prog)s only checks lines '
                             'that are prefixed with "%(default)s". This '
                             'option can be used to change that '
                             'prefix. Leading and trailing whitespace is '
                             'ignored unless the check line contains explicit '
                             '^ or $ characters.')
    args = parser.parse_args()
    compare.compare(args.actual, args.expected, args.check_prefix)


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.09033423667570009, 'fraction_numerical': 0.006022282445046673, 'mean_word_length': 1.9581478183437222, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1884826', 'n_tokens_mistral': 864, 'n_tokens_neox': 811, 'n_words': 298}