<commit_before><?php

namespace Moccalotto\Reporter;

use Commando\Command;

require_once 'vendor/autoload.php';

$app = new App([
    'version' => '@git-version@',

    'args' => function ($app) {
        $args = new Command();

        $args->argument()
            ->aka('config')
            ->describedAs('Use a given configuration File')
            ->defaultsTo('reporter.json')
            ->file()
            ->must(function ($file) {
                Ensure::fileIsReadable($file);
                Ensure::validJson(file_get_contents($file), sprintf(
                    'Data in "%s" is not valid json',
                    $file
                ));

                return true;
            });

        $args->option('d')
            ->aka('dump-config')
            ->describedAs('Dump the complete config to this file');

        $args->option('v')
            ->aka('version')
            ->describedAs('Get the version number')
            ->boolean();

        return $args;
    },

    'config' => function ($app) {
        return Config::fromFileIfExists($app['args']['config']);
    },
]);


$app['http.config'] = [
    'http' => [
        'user_agent' => $app->cfg('http.user_agent'),
        'follow_location' => $app->cfg('http.follow_location', 0),
        'follow_location' => $app->cfg('http.max_redirects', 20),
        'timeout' => $app->cfg('http.timeout', 10),
        'proxy' => $app->cfg('http.proxy', null),
        'ignore_errors' => true,
    ],
    'ssl' => $app->cfg('https'),
];

$app['http'] = function ($app) {
    return new Http($app);
};

$app['signer'] = function ($app) {
    return new Signer(
        $app->cfg('signing.algorithm'),
        $app->cfg('signing.key')
    );
};

$app['sysinfo'] = function ($app) {
    return new SysInfo($app);
};

return $app;<commit_msg>Formatting<commit_after><?php

namespace Moccalotto\Reporter;

use Commando\Command;

require_once 'vendor/autoload.php';

$app = new App([
    'version' => '@git-version@',

    'args' => function ($app) {
        $args = new Command();

        $args->argument()
            ->aka('config')
            ->describedAs('Use a given configuration File')
            ->defaultsTo('reporter.json')
            ->file()
            ->must(function ($file) {
                Ensure::fileIsReadable($file);
                Ensure::validJson(file_get_contents($file), sprintf(
                    'Data in "%s" is not valid json',
                    $file
                ));

                return true;
            });

        $args->option('d')
            ->aka('dump-config')
            ->describedAs('Dump the complete config to this file');

        $args->option('v')
            ->aka('version')
            ->describedAs('Get the version number')
            ->boolean();

        return $args;
    },

    'config' => function ($app) {
        return Config::fromFileIfExists($app['args']['config']);
    },
]);

$app['http.config'] = [
    'http' => [
        'user_agent' => $app->cfg('http.user_agent'),
        'follow_location' => $app->cfg('http.follow_location', 0),
        'follow_location' => $app->cfg('http.max_redirects', 20),
        'timeout' => $app->cfg('http.timeout', 10),
        'proxy' => $app->cfg('http.proxy', null),
        'ignore_errors' => true,
    ],
    'ssl' => $app->cfg('https'),
];

$app['http'] = function ($app) {
    return new Http($app);
};

$app['signer'] = function ($app) {
    return new Signer(
        $app->cfg('signing.algorithm'),
        $app->cfg('signing.key')
    );
};

$app['sysinfo'] = function ($app) {
    return new SysInfo($app);
};

return $app;
{'fraction_non_alphanumeric': 0.19207484865162355, 'fraction_numerical': 0.00275178866263071, 'mean_word_length': 2.075296108291032, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 67, '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': '7512155', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1098, 'n_words': 213}