From 8449a6dac8b4adf0e20bceecbff921d6dc598701 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Wed, 13 Nov 2019 10:13:05 -0700 Subject: [PATCH] Version 0.43 --- Changes | 3 +++ META.json | 28 +++++++++++++------------- META.yml | 28 +++++++++++++------------- Makefile.PL | 2 +- README | 2 +- bin/git-codeowners | 4 ++-- lib/App/Codeowners.pm | 13 ++++++------ lib/App/Codeowners/Formatter.pm | 4 ++-- lib/App/Codeowners/Formatter/CSV.pm | 4 ++-- lib/App/Codeowners/Formatter/JSON.pm | 4 ++-- lib/App/Codeowners/Formatter/String.pm | 4 ++-- lib/App/Codeowners/Formatter/TSV.pm | 4 ++-- lib/App/Codeowners/Formatter/Table.pm | 4 ++-- lib/App/Codeowners/Formatter/YAML.pm | 4 ++-- lib/App/Codeowners/Options.pm | 4 ++-- lib/App/Codeowners/Util.pm | 4 ++-- lib/File/Codeowners.pm | 4 ++-- lib/Test/File/Codeowners.pm | 4 ++-- t/app-codeowners.t | 19 +++++++++++++++++ 19 files changed, 82 insertions(+), 61 deletions(-) diff --git a/Changes b/Changes index 9b62078..9b06826 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for App-Codeowners. +0.43 2019-11-13 10:12:01-07:00 MST7MDT + * Fix "create" and "update" commands... to actually work. + 0.42 2019-11-12 21:52:12-07:00 MST7MDT * Add "projects" command to list defined projects. * Add flags to filter matches with the "show" command. diff --git a/META.json b/META.json index cf36b2d..0e9f30f 100644 --- a/META.json +++ b/META.json @@ -114,55 +114,55 @@ "provides" : { "App::Codeowners" : { "file" : "lib/App/Codeowners.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter" : { "file" : "lib/App/Codeowners/Formatter.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter::CSV" : { "file" : "lib/App/Codeowners/Formatter/CSV.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter::JSON" : { "file" : "lib/App/Codeowners/Formatter/JSON.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter::String" : { "file" : "lib/App/Codeowners/Formatter/String.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter::TSV" : { "file" : "lib/App/Codeowners/Formatter/TSV.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter::Table" : { "file" : "lib/App/Codeowners/Formatter/Table.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Formatter::YAML" : { "file" : "lib/App/Codeowners/Formatter/YAML.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Options" : { "file" : "lib/App/Codeowners/Options.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Util" : { "file" : "lib/App/Codeowners/Util.pm", - "version" : "0.42" + "version" : "0.43" }, "App::Codeowners::Util::Process" : { "file" : "lib/App/Codeowners/Util.pm", - "version" : "0.42" + "version" : "0.43" }, "File::Codeowners" : { "file" : "lib/File/Codeowners.pm", - "version" : "0.42" + "version" : "0.43" }, "Test::File::Codeowners" : { "file" : "lib/Test/File/Codeowners.pm", - "version" : "0.42" + "version" : "0.43" } }, "release_status" : "stable", @@ -177,7 +177,7 @@ "web" : "https://github.com/chazmcgarvey/git-codeowners" } }, - "version" : "0.42", + "version" : "0.43", "x_authority" : "cpan:CCM", "x_generated_by_perl" : "v5.28.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.15" diff --git a/META.yml b/META.yml index 838d588..b30a2a4 100644 --- a/META.yml +++ b/META.yml @@ -31,43 +31,43 @@ no_index: provides: App::Codeowners: file: lib/App/Codeowners.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter: file: lib/App/Codeowners/Formatter.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter::CSV: file: lib/App/Codeowners/Formatter/CSV.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter::JSON: file: lib/App/Codeowners/Formatter/JSON.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter::String: file: lib/App/Codeowners/Formatter/String.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter::TSV: file: lib/App/Codeowners/Formatter/TSV.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter::Table: file: lib/App/Codeowners/Formatter/Table.pm - version: '0.42' + version: '0.43' App::Codeowners::Formatter::YAML: file: lib/App/Codeowners/Formatter/YAML.pm - version: '0.42' + version: '0.43' App::Codeowners::Options: file: lib/App/Codeowners/Options.pm - version: '0.42' + version: '0.43' App::Codeowners::Util: file: lib/App/Codeowners/Util.pm - version: '0.42' + version: '0.43' App::Codeowners::Util::Process: file: lib/App/Codeowners/Util.pm - version: '0.42' + version: '0.43' File::Codeowners: file: lib/File/Codeowners.pm - version: '0.42' + version: '0.43' Test::File::Codeowners: file: lib/Test/File/Codeowners.pm - version: '0.42' + version: '0.43' recommends: Term::Detect::Software: '0' Unicode::GCString: '0' @@ -93,7 +93,7 @@ resources: bugtracker: https://github.com/chazmcgarvey/git-codeowners/issues homepage: https://github.com/chazmcgarvey/git-codeowners repository: https://github.com/chazmcgarvey/git-codeowners.git -version: '0.42' +version: '0.43' x_authority: cpan:CCM x_generated_by_perl: v5.28.0 x_serialization_backend: 'YAML::Tiny version 1.73' diff --git a/Makefile.PL b/Makefile.PL index db4c282..09f972b 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -48,7 +48,7 @@ my %WriteMakefileArgs = ( "Test::Exit" => 0, "Test::More" => 0 }, - "VERSION" => "0.42", + "VERSION" => "0.43", "test" => { "TESTS" => "t/*.t" } diff --git a/README b/README index 98bbc5b..6a6d906 100644 --- a/README +++ b/README @@ -4,7 +4,7 @@ NAME VERSION - version 0.42 + version 0.43 SYNOPSIS diff --git a/bin/git-codeowners b/bin/git-codeowners index 2c680eb..4436ef7 100755 --- a/bin/git-codeowners +++ b/bin/git-codeowners @@ -10,7 +10,7 @@ use strict; use App::Codeowners; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION App::Codeowners->main(@ARGV); @@ -26,7 +26,7 @@ git-codeowners - A tool for managing CODEOWNERS files =head1 VERSION -version 0.42 +version 0.43 =head1 SYNOPSIS diff --git a/lib/App/Codeowners.pm b/lib/App/Codeowners.pm index e70a109..291660a 100644 --- a/lib/App/Codeowners.pm +++ b/lib/App/Codeowners.pm @@ -14,7 +14,7 @@ use Encode qw(encode); use File::Codeowners; use Path::Tiny; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION sub main { @@ -194,11 +194,10 @@ END if ($repopath) { # if there is a repo we can try to update the list of unowned files - my $git_files = git_ls_files($repopath); - if (@$git_files) { - $codeowners->clear_unowned; - $codeowners->add_unowned(grep { !$codeowners->match($_) } @$git_files); - } + my ($proc, @filepaths) = git_ls_files($repopath); + $proc->wait and exit 1; + $codeowners->clear_unowned; + $codeowners->add_unowned(grep { !$codeowners->match($_) } @filepaths); } $codeowners->write_to_filepath($path); @@ -219,7 +218,7 @@ App::Codeowners - A tool for managing CODEOWNERS files =head1 VERSION -version 0.42 +version 0.43 =head1 METHODS diff --git a/lib/App/Codeowners/Formatter.pm b/lib/App/Codeowners/Formatter.pm index 095a6ef..d9e6132 100644 --- a/lib/App/Codeowners/Formatter.pm +++ b/lib/App/Codeowners/Formatter.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use Module::Load; @@ -120,7 +120,7 @@ App::Codeowners::Formatter - Base class for formatting codeowners output =head1 VERSION -version 0.42 +version 0.43 =head1 SYNOPSIS diff --git a/lib/App/Codeowners/Formatter/CSV.pm b/lib/App/Codeowners/Formatter/CSV.pm index a60dc94..331fec1 100644 --- a/lib/App/Codeowners/Formatter/CSV.pm +++ b/lib/App/Codeowners/Formatter/CSV.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter::CSV; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use parent 'App::Codeowners::Formatter'; @@ -63,7 +63,7 @@ App::Codeowners::Formatter::CSV - Format codeowners output as comma-separated va =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/App/Codeowners/Formatter/JSON.pm b/lib/App/Codeowners/Formatter/JSON.pm index 2ead10c..feb0236 100644 --- a/lib/App/Codeowners/Formatter/JSON.pm +++ b/lib/App/Codeowners/Formatter/JSON.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter::JSON; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use parent 'App::Codeowners::Formatter'; @@ -42,7 +42,7 @@ App::Codeowners::Formatter::JSON - Format codeowners output as JSON =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/App/Codeowners/Formatter/String.pm b/lib/App/Codeowners/Formatter/String.pm index 3342331..6303fb5 100644 --- a/lib/App/Codeowners/Formatter/String.pm +++ b/lib/App/Codeowners/Formatter/String.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter::String; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use parent 'App::Codeowners::Formatter'; @@ -136,7 +136,7 @@ App::Codeowners::Formatter::String - Format codeowners output using printf-like =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/App/Codeowners/Formatter/TSV.pm b/lib/App/Codeowners/Formatter/TSV.pm index b2f22bd..4322aaf 100644 --- a/lib/App/Codeowners/Formatter/TSV.pm +++ b/lib/App/Codeowners/Formatter/TSV.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter::TSV; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use parent 'App::Codeowners::Formatter::CSV'; @@ -25,7 +25,7 @@ App::Codeowners::Formatter::TSV - Format codeowners output as tab-separated valu =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/App/Codeowners/Formatter/Table.pm b/lib/App/Codeowners/Formatter/Table.pm index df9bf39..f6c813c 100644 --- a/lib/App/Codeowners/Formatter/Table.pm +++ b/lib/App/Codeowners/Formatter/Table.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter::Table; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use parent 'App::Codeowners::Formatter'; @@ -40,7 +40,7 @@ App::Codeowners::Formatter::Table - Format codeowners output as a table =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/App/Codeowners/Formatter/YAML.pm b/lib/App/Codeowners/Formatter/YAML.pm index 00b4d1e..9919290 100644 --- a/lib/App/Codeowners/Formatter/YAML.pm +++ b/lib/App/Codeowners/Formatter/YAML.pm @@ -5,7 +5,7 @@ package App::Codeowners::Formatter::YAML; use warnings; use strict; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION use parent 'App::Codeowners::Formatter'; @@ -36,7 +36,7 @@ App::Codeowners::Formatter::YAML - Format codeowners output as YAML =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/App/Codeowners/Options.pm b/lib/App/Codeowners/Options.pm index 1bd3c0f..fcc2eae 100644 --- a/lib/App/Codeowners/Options.pm +++ b/lib/App/Codeowners/Options.pm @@ -8,7 +8,7 @@ use Getopt::Long 2.39 (); use Path::Tiny; use Pod::Usage; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION sub early_options { return { @@ -278,7 +278,7 @@ App::Codeowners::Options - Getopt and shell completion for App::Codeowners =head1 VERSION -version 0.42 +version 0.43 =head1 METHODS diff --git a/lib/App/Codeowners/Util.pm b/lib/App/Codeowners/Util.pm index 762f040..dbf5513 100644 --- a/lib/App/Codeowners/Util.pm +++ b/lib/App/Codeowners/Util.pm @@ -23,7 +23,7 @@ our @EXPORT_OK = qw( zip ); -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION sub find_nearest_codeowners { @@ -280,7 +280,7 @@ App::Codeowners::Util - Grab bag of utility subs for Codeowners modules =head1 VERSION -version 0.42 +version 0.43 =head1 DESCRIPTION diff --git a/lib/File/Codeowners.pm b/lib/File/Codeowners.pm index e7b23de..bdaf64c 100644 --- a/lib/File/Codeowners.pm +++ b/lib/File/Codeowners.pm @@ -10,7 +10,7 @@ use Path::Tiny; use Scalar::Util qw(openhandle); use Text::Gitignore qw(build_gitignore_matcher); -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION sub _croak { require Carp; Carp::croak(@_); } sub _usage { _croak("Usage: @_\n") } @@ -354,7 +354,7 @@ File::Codeowners - Read and write CODEOWNERS files =head1 VERSION -version 0.42 +version 0.43 =head1 METHODS diff --git a/lib/Test/File/Codeowners.pm b/lib/Test/File/Codeowners.pm index a166e71..532ec28 100644 --- a/lib/Test/File/Codeowners.pm +++ b/lib/Test/File/Codeowners.pm @@ -10,7 +10,7 @@ use Encode qw(encode); use File::Codeowners; use Test::Builder; -our $VERSION = '0.42'; # VERSION +our $VERSION = '0.43'; # VERSION my $Test = Test::Builder->new; @@ -88,7 +88,7 @@ Test::File::Codeowners - Write tests for CODEOWNERS files =head1 VERSION -version 0.42 +version 0.43 =head1 SYNOPSIS diff --git a/t/app-codeowners.t b/t/app-codeowners.t index 28309d3..5ec78cb 100644 --- a/t/app-codeowners.t +++ b/t/app-codeowners.t @@ -72,6 +72,25 @@ END }; }; +subtest 'create' => sub { + plan skip_all => 'Cannot run git' if !$can_git; + + my $repodir = _setup_git_repo(); + my $chdir = pushd($repodir); + + my $codeowners_filepath = path('CODEOWNERS'); + $codeowners_filepath->remove; + + my ($stdout, $stderr, $exit) = run { App::Codeowners->main(qw{create}) }; + is($exit, 0, 'exited without error'); + is($stderr, "Wrote CODEOWNERS\n", 'reportedly wrote a CODEOWNERS file'); + + ok($codeowners_filepath->is_file, 'did write CODEOWNERS file'); + + my $contents = $codeowners_filepath->slurp_utf8; + like($contents, qr/^# This file shows mappings/, 'correct contents of file') or diag $contents; +}; + done_testing; exit; -- 2.44.0