App::Codeowners::Formatter - Base class for formatting codeowners output
version 0.49
my $formatter = App::Codeowners::Formatter->new(handle => *STDOUT); $formatter->add_result($_) for @results;
This is a base class for formatters. A formatter is a class that takes data records, stringifies them, and prints them to an IO handle.
This class is mostly abstract, though it is also usable as a null formatter where results are simply discarded if it is instantiated directly. These other formatters do more interesting things:
App::Codeowners::Formatter::CSV
App::Codeowners::Formatter::String
App::Codeowners::Formatter::JSON
App::Codeowners::Formatter::TSV
App::Codeowners::Formatter::Table
App::Codeowners::Formatter::YAML
Get the IO handle associated with a formatter.
Get the format string, which may be used to customize the formatting.
Get an arrayref of column headings.
Get an arrayref of all the results that have been provided to the formatter using "add_result" but have not yet been formatted.
$formatter = App::Codeowners::Formatter->new; $formatter = App::Codeowners::Formatter->new(%attributes);
Construct a new formatter.
Destructor calls "finish".
$formatter->add_result($result);
Provide an additional lint result to be formatted.
$formatter->start;
Begin formatting results. Called before any results are passed to the "stream" method.
This method may print a header to the "handle". This method is used by subclasses and should typically not be called explicitly.
$formatter->stream(\@result, ...);
Format one result.
This method is expected to print a string representation of the result to the "handle". This method is used by subclasses and should typically not called be called explicitly.
The default implementation simply stores the "results" so they will be available to "finish".
$formatter->finish;
End formatting results. Called after all results are passed to the "stream" method.
This method may print a footer to the "handle". This method is used by subclasses and should typically not be called explicitly.
@formatters = App::Codeowners::Formatter->formatters;
Get a list of package names of potential formatters within the App::Codeowners::Formatter namespace.
App::Codeowners::Formatter
Please report any bugs or feature requests on the bugtracker website https://github.com/chazmcgarvey/git-codeowners/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Charles McGarvey <chazmcgarvey@brokenzipper.com>
This software is copyright (c) 2019 by Charles McGarvey.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::Codeowners, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Codeowners
CPAN shell
perl -MCPAN -e shell install App::Codeowners
For more information on module installation, please visit the detailed CPAN module installation guide.