summaryrefslogtreecommitdiff
path: root/t/porting
diff options
context:
space:
mode:
authorBram <perl-rt@wizbit.be>2022-08-07 14:49:36 +0200
committerYves Orton <demerphq@gmail.com>2022-09-03 11:18:17 +0200
commit8975221916115baa0cf0fceb2f33c1abb6ae50b9 (patch)
tree2b3912fbffec0b61364a841924d617f33de1ddd8 /t/porting
parent127965c0498c25086a603d2188484b2aa8f26af3 (diff)
downloadperl-8975221916115baa0cf0fceb2f33c1abb6ae50b9.tar.gz
Add a .github/README.md
This is based on the existing README and is an almost exact copy. Some minor formatting changes to improve the rendering but the text remains the same. This is done because not having a formatted README is blocking some other changes.[^1] t/porting/copyright.t was also adjusted to check the copyright in .github/README.md *Long term*: In the long term the contents of README and .github/README.md will differ. Since these serve a different purpose: - README: this is included with each release and for that it's more then good enough enough; - .github/README.md: this is for people viewing the repository on GitHub and for that the current README is - in my opinion - not good enough. It should be much more informative (compare it with some other repos and that should be obvious, in #18965 there are some examples but many more exist). [^1]: rendering platform specific READMEs as POD in GitHub.
Diffstat (limited to 't/porting')
-rw-r--r--t/porting/copyright.t21
1 files changed, 19 insertions, 2 deletions
diff --git a/t/porting/copyright.t b/t/porting/copyright.t
index 8a469cda89..11152683fb 100644
--- a/t/porting/copyright.t
+++ b/t/porting/copyright.t
@@ -30,6 +30,12 @@ my ($opt) = @ARGV;
my $readme_year = readme_year();
my $v_year = v_year();
+my $gh_readme_year;
+if (-e "../.github/README.md")
+{
+ $gh_readme_year = readme_year(".github/README.md");
+}
+
# Check that both copyright dates are up-to-date, but only if requested, so
# that tests still pass for people intentionally working on older versions:
@@ -38,12 +44,22 @@ if ($opt eq '--now')
my $current_year = (gmtime)[5] + 1900;
is $v_year, $current_year, 'perl -v copyright includes current year';
is $readme_year, $current_year, 'README copyright includes current year';
+ if ($gh_readme_year)
+ {
+ is ($gh_readme_year, $current_year,
+ '.github/README.md copyright includes current year');
+ }
}
# Otherwise simply check that the two copyright dates match each other:
else
{
is $readme_year, $v_year, 'README and perl -v copyright dates match';
+ if ($gh_readme_year)
+ {
+ is ($gh_readme_year, $v_year,
+ '.github/README.md and perl -v copyright dates match');
+ }
}
done_testing;
@@ -52,15 +68,16 @@ done_testing;
sub readme_year
# returns the latest copyright year from the top-level README file
{
+ my $file = shift || "README";
- open my $readme, '<', '../README' or die "Opening README failed: $!";
+ open my $readme, '<', "../$file" or die "Opening $file failed: $!";
# The copyright message is the first paragraph:
local $/ = '';
my $copyright_msg = <$readme>;
my ($year) = $copyright_msg =~ /.*\b(\d{4,})/s
- or die "Year not found in README copyright message '$copyright_msg'";
+ or die "Year not found in $file copyright message '$copyright_msg'";
$year;
}