]>
Dogcows Code - chaz/git-codeowners/blob - lib/App/Codeowners/Formatter/JSON.pm
1 package App
::Codeowners
::Formatter
::JSON
;
2 # ABSTRACT: Format codeowners output as JSON
8 our $VERSION = '0.48'; # VERSION
10 use parent
'App::Codeowners::Formatter';
12 use App
::Codeowners
::Util
qw(zip);
19 eval { require JSON
::MaybeXS
} or die "Missing dependency: JSON::MaybeXS\n";
22 $options{pretty
} = 1 if lc($self->format) eq 'pretty';
24 my $json = JSON
::MaybeXS-
>new(canonical
=> 1, utf8
=> 1, %options);
26 my $columns = $self->columns;
27 $results = [map { +{zip
@$columns, @$_} } @$results];
28 print { $self->handle } $json->encode($results);
41 App::Codeowners::Formatter::JSON - Format codeowners output as JSON
49 This is a L<App::Codeowners::Formatter> that formats output using L<JSON::MaybeXS>.
55 If unset (default), the output will be compact. If "pretty", the output will look nicer to humans.
59 Please report any bugs or feature requests on the bugtracker website
60 L<https://github.com/chazmcgarvey/git-codeowners/issues>
62 When submitting a bug or request, please include a test-file or a
63 patch to an existing test-file that illustrates the bug or desired
68 Charles McGarvey <chazmcgarvey@brokenzipper.com>
70 =head1 COPYRIGHT AND LICENSE
72 This software is copyright (c) 2019 by Charles McGarvey.
74 This is free software; you can redistribute it and/or modify it under
75 the same terms as the Perl 5 programming language system itself.
This page took 0.037205 seconds and 5 git commands to generate.