Test::...espaces(3pm)
π NAME π
okay so bestie, meet Test::CleanNamespaces β it checks for uncleaned imports. that's the whole vibe. (also fun fact, the man page itself answers to Test::...espaces(3pm) up in the header, which is giving "my name got truncated in a text message" energy but whatever, we love her.) β¨
π VERSION π
version 0.24 β she's on 0.24, no cap.
π¦ SYNOPSIS π¦
okay so this is literally how you use her:
use strict;
use warnings;
use Test::CleanNamespaces;
all_namespaces_clean;
that's it. that's the whole thing. iconic.
πΈ DESCRIPTION πΈ
so here's the tea β β this module lets you check your module's namespaces for imported functions you might have forgotten to remove with namespace::autoclean or namespace::clean. and why do we care?? because those leftover imports are therefore available to be called as methods, which usually isn't what you want. like, bestie, that's not the moment. π
β¨ FUNCTIONS β¨
good news: all functions are exported by default. no extra setup, she just shows up. periodt. π
π namespaces_clean
namespaces_clean('YourModule', 'AnotherModule');
tests every specified namespace for uncleaned imports. and if the module couldn't be loaded? it just gets skipped. no drama, she moves on. π«Ά
π all_namespaces_clean
all_namespaces_clean;
runs namespaces_clean for all modules in your distribution. the full sweep. main character energy. π
π§ find_modules
my @modules = Test::CleanNamespaces->find_modules;
returns a list of modules in the current distribution. it'll search in blib/ if it exists β and lib/ will be searched otherwise. iykyk. π¦
β builder
my $builder = Test::CleanNamespaces->builder;
returns the Test::Builder used by the test functions. that's the one. π«
π KNOWN ISSUES π
not me having to report this one π
uncleaned imports from Mouse classes are incompletely detected, due to its lack of ability to return the correct method list β it assumes that all subs are meant to be callable as methods unless they originated from (were imported by) one of: Mouse, Mouse::Role, Mouse::Util, Mouse::Util::TypeConstraints, Carp, Scalar::Util, or List::Util.
like, she's trying her best, fr fr. π
π SEE ALSO π
the whole friend group, honestly. obsessed with all of them:
namespace::cleannamespace::autocleannamespace::sweepSub::Exporter::ForMethodsTest::APISub::NameSub::InstallMooseX::MarkAsMethodsDist::Zilla::Plugin::Test::CleanNamespaces
π«Ά SUPPORT π«Ά
got beef with a bug? bestie, take it to the RT bug tracker: <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-CleanNamespaces> β or email <bug-Test-CleanNamespaces@rt.cpan.org> π
there's also a mailing list available for users of this distribution, at <http://lists.perl.org/list/perl-qa.html>. very "join the group chat" of it. β¨
and there's also an irc channel available for users of this distribution, at "#perl" on irc.perl.org (<irc://irc.perl.org/#perl-qa>). come say hi, we don't bite. πΈ
π AUTHOR π
Florian Ragwitz <rafl@debian.org> β the legend herself. π
π CONTRIBUTORS π
- Karen Etheridge <ether@cpan.org>
- Graham Knop <haarg@haarg.org>
π COPYRIGHT AND LICENCE π
this software is copyright (c) 2009 by Florian Ragwitz. π
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, honestly.
and that's a wrap, bestie π this wasTest::...espaces(3pm)from theperl v5.28.1era, dated2018-12-14, brought to you by User Contributed Perl Documentation. she's a little vintage, she's a little iconic, and she's still checking your namespaces. periodt. β¨π¦
π¦ where this page comes from
- debian bookworm: libtest-cleannamespaces-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-cleannamespaces-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libtest-cleannamespaces-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-cleannamespaces-perl 0.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms