logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Test::Tabs - check the presence of tabs in your project

Author

       Toby Inkster <tobyink@cpan.org>.

       Large portions stolen from Test::NoTabs by Nick Gerakines.

Bugs

       Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=Test-Tabs>.

Description

       This module scans your project/distribution for any perl files (scripts, modules, etc) for the presence
       of tabs.

       In particular, it checks that all indentation is done using tabs, not spaces; alignment is done via
       spaces, not tabs; indentation levels never jump up (e.g. going from 1 tab indent to 3 tab indent without
       an intervening 2 tab indent); and there is no trailing whitespace on any line (though lines may consist
       entirely of whitespace).

       Comment lines and pod are ignored. (A future version may also ignore heredocs.)

       A trailing comment "##WS" can be used to ignore all whitespace rules for that line. "## no Test::Tabs"
       can be used to begin ignoring whitespace rules for all following lines until "## use Test::Tabs" is seen.
       "## skip Test::Tabs" tells Test::Tabs to skip the current file, but it must be used before the first
       whitespace rule violation.

   Functions
       all_perl_files_ok( @directories )
           Applies  tabs_ok() to all perl files found in @directories recursively. If no @directories are given,
           the starting point is one level above the current running script, that should cover all the files  of
           a  typical  CPAN  distribution.  A  perl  file  is  *.pl,  *.pm, *.psgi, *.t, or a file starting with
           "#!...perl".

       "tabs_ok( $file, $text )"
           Run a tab check on $file. For a module, either the path  ("lib/My/Module.pm")  or  the  package  name
           ("My::Module") can be used.

           $text is the optional test name.

Disclaimer Of Warranties

       THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT  ANY  EXPRESS  OR  IMPLIED  WARRANTIES,  INCLUDING,  WITHOUT
       LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

perl v5.40.1                                       2025-08-14                                    Test::Tabs(3pm)

Name

       Test::Tabs - check the presence of tabs in your project

See Also

       Test::EOL, Test::More.

Synopsis

               use Test::Tabs tests => 1;
               tabs_ok('lib/Module.pm', 'Module is indented sanely');

       Or

               use Test::Tabs;
               all_perl_files_ok();

       Or

               use Test::Tabs;
               all_perl_files_ok( @mydirs );

See Also