pjcj / Devel--Cover

Code coverage metrics for Perl
http://www.pjcj.net/perl.html
93 stars 89 forks source link

use CPAN::Meta for reading MYMETA.json #314

Closed eserte closed 1 year ago

eserte commented 1 year ago

Rationale for this change: by using Devel::Cover::DB::IO::JSON for reading MYMETA.json a MYMETA.json.lock is created and not removed, thus leaving an unclean directory (unclean for git or for "make distcheck"). Probably it is better anyway to use the core module CPAN::Meta which exactly exists for the purpose of reading META/MYMETA files.

CPAN::Meta is a core perl module since perl 5.14. For perls earlier than 5.14 CPAN::Meta would be needed to installed from CPAN. I have the assumption that reading the MYMETA.json information is kind of optional, so I did not add a PREREQ_PM dependency for older perls. If I am wrong, then this should be done.

This patch addresses my comment https://github.com/pjcj/Devel--Cover/issues/263#issuecomment-792797781 However, it is unclear if the original issue author was also stumbling over the MYMETA.json.lock files, or whether lock files for the database json files were problematic for her/him.

pjcj commented 1 year ago

Thanks very much for this! I have merged it with d4ff6148363807eee6bf77e1d4a14baa07ae1361

You're right that it's not essential. This just means that 5.12 will npw be missing a little information.