Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Author/Release tests for general codestyle bugs
Perl
branch: releases

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/Test
t
Build.PL
Changes
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README

README

NAME
    Test::Whitespace - Check your dist for excess whitespace.

VERSION
    version 0.0100

SYNOPSIS
  Declarative
        use Test::Whitespace (
            scan_for => [
                'eol', 'tab' , 'extra' => [
                    [ qr/\x504/, '\x504 {{err}}' ],
                    [ qr/){/, 'Untidyness {{err}}' ],
                ]
            ]       
            in => [ '/path/to/dir/' ],
            types => sub { $_->perlmodule }, 
        );

    Automatically scans for \s+$ , \t and other extra regexen in all perl
    modules in /path/to/dir.

  Objective
        use Test::More plan => 5;
        # Import 2 Symbols for you.
        use Test::Whitespace;

        my $rs = WhitespaceRuleSet
            ->new
            ->tailing
            ->tabs
            ->add_rule( qr/\x504/, '\x504 {{err}}' )
            ->add_rule( qr/){/, 'Untidyness {{err}}' );

        my @files = ( ... );
        for ( @files ){
            my $stat = $rs->test_file( $_ );
            ok( $stat->[0] , "Test for $_ whitespace");
            diag( $stat->[1] ) unless $stat->[0] ;
        }

    Works more or less the same, but with more control and doing it the hard
    way.

PRIMARY AUDIENCE
    This Module is intended for Author Testing and Release testing.

RATIONALE / PRIMARY AUDIENCE
    There are many cases where Perl::Critic is useless to you:

    *   You have Non-Perl files that may be shipping with your dist

        For example, ".js" files, ".yaml" files, ".json" files, ".html"
        files.

    *   You don't care for any other critic policies.

        You just want to keep whitespace consistent and repressed.

    *   You have your own weird regex you want to mandate.

        And you never want to see that a string in your dist matches that
        regex, and you really cant be arsed writing a full blown critic
        policy and uploading it on CPAN for this one tiny case.

    In all of the above cases, this module is for you.

AUTHOR
      Kent Fredric <kentnl at cpan.org>

COPYRIGHT AND LICENSE
    This software is copyright (c) 2009 by Kent Fredric.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

Something went wrong with that request. Please try again.