summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/buildtable.pl8
-rwxr-xr-xscripts/diffcheck.sh13
-rwxr-xr-xscripts/link-format-chk.sh23
3 files changed, 41 insertions, 3 deletions
diff --git a/scripts/buildtable.pl b/scripts/buildtable.pl
index 144ede6..292f1ee 100755
--- a/scripts/buildtable.pl
+++ b/scripts/buildtable.pl
@@ -34,6 +34,7 @@ my %MiscField = (
'Discussions-To' => undef,
'Post-History' => undef,
'Replaces' => undef,
+ 'Requires' => undef,
'Superseded-By' => undef,
);
@@ -53,6 +54,7 @@ my %ValidStatus = (
Final => "background-color: #cfffcf",
Active => "background-color: #cfffcf",
Replaced => "background-color: #ffcfcf",
+ Obsolete => "background-color: #ffcfcf",
);
my %ValidType = (
'Standards Track' => 'Standard',
@@ -87,7 +89,7 @@ my %DefinedLicenses = (
);
my %GrandfatheredPD = map { $_ => undef } qw(9 36 37 38 42 49 50 60 65 67 69 74 80 81 83 90 99 105 107 109 111 112 113 114 122 124 125 126 130 131 132 133 140 141 142 143 144 146 147 150 151 152);
my %TolerateMissingLicense = map { $_ => undef } qw(1 10 11 12 13 14 15 16 21 31 33 34 35 39 43 44 45 47 61 64 68 70 71 72 73 101 102 106 120 121);
-my %TolerateTitleTooLong = map { $_ => undef } qw(39 44 45 47 49 60 67 68 69 73 74 75 80 81 99 105 106 109 113 122 126 131 143 145 147 173);
+my %TolerateTitleTooLong = map { $_ => undef } qw(39 44 45 47 49 60 67 68 69 73 74 75 80 81 99 105 106 109 113 122 126 131 143 145 147 173 327);
my %emails;
@@ -123,9 +125,9 @@ while (++$bipnum <= $topbip) {
} elsif ($field eq 'Title') {
$title = $val;
my $title_len = length($title);
- die "$fn has too-long TItle ($title_len > 44 char max)" if $title_len > 44 and not exists $TolerateTitleTooLong{$bipnum};
+ die "$fn has too-long Title ($title_len > 44 char max)" if $title_len > 44 and not exists $TolerateTitleTooLong{$bipnum};
} elsif ($field eq 'Author') {
- $val =~ m/^(\S[^<@>]*\S) \<([^@>]*\@[\w.]+\.\w+)\>$/ or die "Malformed Author line in $fn";
+ $val =~ m/^(\S[^<@>]*\S) \<([^@>]*\@[\w.-]+\.\w+)\>$/ or die "Malformed Author line in $fn";
my ($authorname, $authoremail) = ($1, $2);
$authoremail =~ s/(?<=\D)$bipnum(?=\D)/<BIPNUM>/g;
$emails{$authorname}->{$authoremail} = undef;
diff --git a/scripts/diffcheck.sh b/scripts/diffcheck.sh
new file mode 100755
index 0000000..4e4c459
--- /dev/null
+++ b/scripts/diffcheck.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+diff README.mediawiki /tmp/table.mediawiki | grep '^[<>] |' >/tmp/after.diff || true
+if git checkout HEAD^ && scripts/buildtable.pl >/tmp/table.mediawiki 2>/dev/null; then
+ diff README.mediawiki /tmp/table.mediawiki | grep '^[<>] |' >/tmp/before.diff || true
+ newdiff=$(diff -s /tmp/before.diff /tmp/after.diff -u | grep '^+')
+ if [ -n "$newdiff" ]; then
+ echo "$newdiff"
+ exit 1
+ fi
+else
+ echo 'Cannot build previous commit table for comparison'
+fi
diff --git a/scripts/link-format-chk.sh b/scripts/link-format-chk.sh
new file mode 100755
index 0000000..e3f0f6d
--- /dev/null
+++ b/scripts/link-format-chk.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+#
+# Copyright (c) 2019 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#
+# Check wrong mediawiki link format
+
+ECODE=0
+FILES=""
+for fname in $(git diff --name-only HEAD $(git merge-base HEAD master)); do
+ if [[ $fname == *.mediawiki ]]; then
+ GRES=$(grep -n '](http' $fname)
+ if [ "$GRES" != "" ]; then
+ if [ $ECODE -eq 0 ]; then
+ >&2 echo "Github Mediawiki format writes link as [URL text], not as [text](url):"
+ fi
+ ECODE=1
+ echo "- $fname:$GRES"
+ fi
+ fi
+done
+exit $ECODE