<commit_before>#! perl
# Copyright (C) 2001-2006, The Perl Foundation.
# $Id$

use strict;
use warnings;

use lib qw(. lib ../lib ../../lib);

use ExtUtils::Manifest qw(maniread);
use Fatal qw(open);
use File::Find;
use Test::More;

BEGIN {
    eval { require Test::Perl::Critic; };
    if ($@) {
        plan skip_all => 'Test::Perl::Critic not installed';
    }
    Test::Perl::Critic->import(-verbose => 2);
}

my $perl_tidy_conf = 'tools/util/perltidy.conf';

my ( @files, %policies, $list_policies );

while (@ARGV) {
    my $arg = $ARGV[0];
    if ( $arg eq '--' ) {
        shift @ARGV;    # discard
        last;
    }
    if ( $arg eq '--list' ) {
        $list_policies = 1;
        shift @ARGV;    # discard
    }
    elsif ( $arg =~ /^--(.*)/ ) {
        $policies{$1} = 1;
        if ($1 eq 'CodeLayout::ProhibitHardTabs') {
            $policies{$1} = { allow_leading_tabs => 0 };
        }
        elsif ($1 eq 'CodeLayout::RequireTidyCode') {
            $policies{$1} = { perltidyrc => $perl_tidy_conf };
        }
        shift @ARGV;    # discard
    }
    else {
        last;
    }
}

# By default, don't complain about anything.
my $config = Perl::Critic::Config->new( -exclude => [qr/.*/] );

# Add in the few cases we should care about.
# For a list of available policies, perldoc Perl::Critic
if ( !keys %policies ) {
    %policies = (
        'TestingAndDebugging::RequireUseStrict'            => 1,
        'TestingAndDebugging::RequireUseWarnings'          => 1,
        'TestingAndDebugging::RequirePortableShebang'      => 1,
        'TestingAndDebugging::ProhibitShebangWarningsArg'  => 1,
        'TestingAndDebugging::MisplacedShebang'            => 1,
        'Variables::ProhibitConditionalDeclarations'       => 1,<commit_msg>Removed ugly personal hack which I didn't mean to commit along with hard tab changes.<commit_after>#! perl
# Copyright (C) 2001-2006, The Perl Foundation.
# $Id$

use strict;
use warnings;

use lib qw(. lib ../lib ../../lib);

use ExtUtils::Manifest qw(maniread);
use Fatal qw(open);
use File::Find;
use Test::More;

BEGIN {
    eval { require Test::Perl::Critic; };
    if ($@) {
        plan skip_all => 'Test::Perl::Critic not installed';
    }
    Test::Perl::Critic->import(-verbose => 2);
}

my $perl_tidy_conf = 'tools/util/perltidy.conf';

my ( @files, %policies, $list_policies );

while (@ARGV) {
    my $arg = $ARGV[0];
    if ( $arg eq '--' ) {
        shift @ARGV;    # discard
        last;
    }
    if ( $arg eq '--list' ) {
        $list_policies = 1;
        shift @ARGV;    # discard
    }
    elsif ( $arg =~ /^--(.*)/ ) {
        $policies{$1} = 1;
        shift @ARGV;    # discard
    }
    else {
        last;
    }
}

# By default, don't complain about anything.
my $config = Perl::Critic::Config->new( -exclude => [qr/.*/] );

# Add in the few cases we should care about.
# For a list of available policies, perldoc Perl::Critic
if ( !keys %policies ) {
    %policies = (
        'TestingAndDebugging::RequireUseStrict'            => 1,
        'TestingAndDebugging::RequireUseWarnings'          => 1,
        'TestingAndDebugging::RequirePortableShebang'      => 1,
        'TestingAndDebugging::ProhibitShebangWarningsArg'  => 1,
        'TestingAndDebugging::MisplacedShebang'            => 1,
        'Variables::ProhibitConditionalDeclarations'       => 1,
{'fraction_non_alphanumeric': 0.1573134328358209, 'fraction_numerical': 0.012835820895522388, 'mean_word_length': 2.4334016393442623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '1275190', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1155, 'n_words': 271}