texlive[74593] trunk: bibcop (12mar25)

commits+karl at tug.org commits+karl at tug.org
Wed Mar 12 20:34:54 CET 2025


Revision: 74593
          https://tug.org/svn/texlive?view=revision&revision=74593
Author:   karl
Date:     2025-03-12 20:34:53 +0100 (Wed, 12 Mar 2025)
Log Message:
-----------
bibcop (12mar25)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/bibcop/bibcop.pl
    trunk/Master/texmf-dist/doc/bibtex/bibcop/bibcop.pdf
    trunk/Master/texmf-dist/doc/man/man1/bibcop.1
    trunk/Master/texmf-dist/doc/man/man1/bibcop.man1.pdf
    trunk/Master/texmf-dist/scripts/bibcop/bibcop.pl
    trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx
    trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty

Modified: trunk/Build/source/texk/texlive/linked_scripts/bibcop/bibcop.pl
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/bibcop/bibcop.pl	2025-03-12 19:34:37 UTC (rev 74592)
+++ trunk/Build/source/texk/texlive/linked_scripts/bibcop/bibcop.pl	2025-03-12 19:34:53 UTC (rev 74593)
@@ -2,7 +2,7 @@
 # SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
 # SPDX-License-Identifier: MIT
 
-# 2025/03/10 0.0.30
+# 2025/03/12 0.0.31
 package bibcop;
 
 use warnings;
@@ -435,8 +435,8 @@
     }
     my $max = 64;
     my $len = length($url);
-    if ($len gt $max) {
-      return "The length of the URL in 'howpublished' is too big ($len > $max), use URL shoftener: '$url'"
+    if ($len > $max) {
+      return "The length of the URL in 'howpublished' is too big ($len > $max), use URL shortener: '$url'"
     }
   }
 }
@@ -640,27 +640,25 @@
 sub fix_month {
   my ($value) = @_;
   my %months = (
-    '1' => 'jan',
-    '2' => 'feb',
-    '3' => 'mar',
-    '4' => 'apr',
+    '1' => 'jan|january',
+    '2' => 'feb|february',
+    '3' => 'mar|march',
+    '4' => 'apr|april',
     '5' => 'may',
-    '6' => 'jun',
-    '7' => 'jul',
-    '8' => 'aug',
-    '9' => 'sep',
-    '10' => 'oct',
-    '11' => 'nov',
-    '12' => 'dec',
+    '6' => 'jun|june',
+    '7' => 'jul|july',
+    '8' => 'aug|august',
+    '9' => 'sep|september',
+    '10' => 'oct|october',
+    '11' => 'nov|november',
+    '12' => 'dec|december',
   );
-  $value =~ s/^0+//g;
-  if ($value =~ /^11|12|[0-9]$/) {
-    $value = $months{$value};
-  } else {
-    my %rev = reverse %months;
-    my $lc = substr(lc($value), 0, 3);
-    if (exists $rev{$lc}) {
-      $value = $lc;
+  $value =~ s/^(0| )+//g;
+  $value =~ s/(0| )+$//g;
+  while(my($v, $re) = each %months) {
+    if ($value =~ qr/$re/i) {
+      $value = $v;
+      last;
     }
   }
   return $value;
@@ -720,19 +718,14 @@
 
 sub fix_pages {
   my ($value) = @_;
-  if ($value =~ /^[1-9][0-9]*$/) {
+  if ($value =~ /^[1-9][0-9]*$/ || $value eq '') {
     return $value;
   }
-  if ($value eq '') {
-    return $value;
-  }
   my ($left, $right) = split(/---|--|-|–|—|\s/, $value);
-  $left //= $right;
-  if ($left eq '') {
+  if (!defined $left || $left eq '') {
     $left = $right;
   }
-  $right //= $left;
-  if ($right eq '') {
+  if (!defined $right || $right eq '') {
     $right = $left;
   }
   $left =~ s/^0+//g;
@@ -773,7 +766,7 @@
     'Sixth' => '6th',
     'Seventh' => '7th',
     'Eighth' => '8th',
-    'Nineth' => '9th',
+    'Ninth' => '9th',
     'Tenth' => '10th'
   );
   keys %numbers;
@@ -934,11 +927,11 @@
     } elsif ($s eq 'brackets') {
       if ($char eq '\\') {
         $escape = 1;
-      } elsif ($char eq '{' and $escape ne 1) {
+      } elsif ($char eq '{' and $escape != 1) {
         $nest = $nest + 1;
-      } elsif ($char eq '}' and $escape ne 1) {
+      } elsif ($char eq '}' and $escape != 1) {
         $nest = $nest - 1;
-        if ($nest eq 0) {
+        if ($nest == 0) {
           $entry{$tag} = substr($acc, 1);
           $s = 'value';
         }
@@ -1090,7 +1083,7 @@
     "      --latex     Report errors in LaTeX format using the \\PackageWarningNoLine command\n\n" .
     "If any issues, please, report to GitHub: https://github.com/yegor256/bibcop");
 } elsif (exists $args{'--version'} or exists $args{'-v'}) {
-  info('0.0.30 2025/03/10');
+  info('0.0.31 2025/03/12');
 } else {
   my ($file) = grep { not($_ =~ /^-.*$/) } @ARGV;
   if (not $file) {

Modified: trunk/Master/texmf-dist/doc/bibtex/bibcop/bibcop.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/man/man1/bibcop.1
===================================================================
--- trunk/Master/texmf-dist/doc/man/man1/bibcop.1	2025-03-12 19:34:37 UTC (rev 74592)
+++ trunk/Master/texmf-dist/doc/man/man1/bibcop.1	2025-03-12 19:34:53 UTC (rev 74593)
@@ -1,4 +1,4 @@
-.TH bibcop 1 "2025/03/10"
+.TH bibcop 1 "2025/03/12"
 .SH NAME
 bibcop \- Style Checker and Fixer of BibTeX Files (.bib)
 .SH SYNOPSIS

Modified: trunk/Master/texmf-dist/doc/man/man1/bibcop.man1.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/scripts/bibcop/bibcop.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/bibcop/bibcop.pl	2025-03-12 19:34:37 UTC (rev 74592)
+++ trunk/Master/texmf-dist/scripts/bibcop/bibcop.pl	2025-03-12 19:34:53 UTC (rev 74593)
@@ -2,7 +2,7 @@
 # SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
 # SPDX-License-Identifier: MIT
 
-# 2025/03/10 0.0.30
+# 2025/03/12 0.0.31
 package bibcop;
 
 use warnings;
@@ -435,8 +435,8 @@
     }
     my $max = 64;
     my $len = length($url);
-    if ($len gt $max) {
-      return "The length of the URL in 'howpublished' is too big ($len > $max), use URL shoftener: '$url'"
+    if ($len > $max) {
+      return "The length of the URL in 'howpublished' is too big ($len > $max), use URL shortener: '$url'"
     }
   }
 }
@@ -640,27 +640,25 @@
 sub fix_month {
   my ($value) = @_;
   my %months = (
-    '1' => 'jan',
-    '2' => 'feb',
-    '3' => 'mar',
-    '4' => 'apr',
+    '1' => 'jan|january',
+    '2' => 'feb|february',
+    '3' => 'mar|march',
+    '4' => 'apr|april',
     '5' => 'may',
-    '6' => 'jun',
-    '7' => 'jul',
-    '8' => 'aug',
-    '9' => 'sep',
-    '10' => 'oct',
-    '11' => 'nov',
-    '12' => 'dec',
+    '6' => 'jun|june',
+    '7' => 'jul|july',
+    '8' => 'aug|august',
+    '9' => 'sep|september',
+    '10' => 'oct|october',
+    '11' => 'nov|november',
+    '12' => 'dec|december',
   );
-  $value =~ s/^0+//g;
-  if ($value =~ /^11|12|[0-9]$/) {
-    $value = $months{$value};
-  } else {
-    my %rev = reverse %months;
-    my $lc = substr(lc($value), 0, 3);
-    if (exists $rev{$lc}) {
-      $value = $lc;
+  $value =~ s/^(0| )+//g;
+  $value =~ s/(0| )+$//g;
+  while(my($v, $re) = each %months) {
+    if ($value =~ qr/$re/i) {
+      $value = $v;
+      last;
     }
   }
   return $value;
@@ -720,19 +718,14 @@
 
 sub fix_pages {
   my ($value) = @_;
-  if ($value =~ /^[1-9][0-9]*$/) {
+  if ($value =~ /^[1-9][0-9]*$/ || $value eq '') {
     return $value;
   }
-  if ($value eq '') {
-    return $value;
-  }
   my ($left, $right) = split(/---|--|-|–|—|\s/, $value);
-  $left //= $right;
-  if ($left eq '') {
+  if (!defined $left || $left eq '') {
     $left = $right;
   }
-  $right //= $left;
-  if ($right eq '') {
+  if (!defined $right || $right eq '') {
     $right = $left;
   }
   $left =~ s/^0+//g;
@@ -773,7 +766,7 @@
     'Sixth' => '6th',
     'Seventh' => '7th',
     'Eighth' => '8th',
-    'Nineth' => '9th',
+    'Ninth' => '9th',
     'Tenth' => '10th'
   );
   keys %numbers;
@@ -934,11 +927,11 @@
     } elsif ($s eq 'brackets') {
       if ($char eq '\\') {
         $escape = 1;
-      } elsif ($char eq '{' and $escape ne 1) {
+      } elsif ($char eq '{' and $escape != 1) {
         $nest = $nest + 1;
-      } elsif ($char eq '}' and $escape ne 1) {
+      } elsif ($char eq '}' and $escape != 1) {
         $nest = $nest - 1;
-        if ($nest eq 0) {
+        if ($nest == 0) {
           $entry{$tag} = substr($acc, 1);
           $s = 'value';
         }
@@ -1090,7 +1083,7 @@
     "      --latex     Report errors in LaTeX format using the \\PackageWarningNoLine command\n\n" .
     "If any issues, please, report to GitHub: https://github.com/yegor256/bibcop");
 } elsif (exists $args{'--version'} or exists $args{'-v'}) {
-  info('0.0.30 2025/03/10');
+  info('0.0.31 2025/03/12');
 } else {
   my ($file) = grep { not($_ =~ /^-.*$/) } @ARGV;
   if (not $file) {

Modified: trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx
===================================================================
--- trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx	2025-03-12 19:34:37 UTC (rev 74592)
+++ trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx	2025-03-12 19:34:53 UTC (rev 74593)
@@ -31,7 +31,7 @@
 %<package>\NeedsTeXFormat{LaTeX2e}
 %<package>\ProvidesPackage{bibcop}
 %<*package>
-[2025/03/10 0.0.30 Style Checker of Bibliography Files]
+[2025/03/12 0.0.31 Style Checker of Bibliography Files]
 %</package>
 %<*driver>
 \documentclass{ltxdoc}
@@ -89,7 +89,7 @@
 % Some warnings may be printed in the \TeX{} log.
 % Once the issues in the |main.bib| file are fixed, the warnings disappear.
 
-% Bibcop doesn't pay much attention the formatting of the |.bib| file. It doesn't emit
+% Bibcop doesn't pay much attention to the formatting of the |.bib| file. It doesn't emit
 % warnings if a comma is missed after the last tag in a \BibTeX{} entry or the tags
 % and their equation symbols are not aligned. Instead, Bibcop is focused on the content
 % of the tags and their possible inconsistencies.
@@ -148,7 +148,7 @@
 % \item |nodoi| allows the absence of the |doi| tag in all entries;
 % \item |noinproc| allows the |booktitle| tag in |@inproceedings| entries to not start with ``Proceedings of the'';
 % \item |noorg| allows mentioning of ACM/IEEE in the |booktitle| tag;
-% \item |notags| allows any tags and allow to miss important tags.
+% \item |notags| allows any tags and allows missing important tags.
 % \end{itemize}
 
 % \section{The Rules}
@@ -169,7 +169,7 @@
 % \href{https://www.doi.org}{Digital Object Identifier}
 % of the material that you reference. It seems to be a good practice, in order to avoid ambiguity,
 % to always mention the DOI.
-% It also recommended to use the \href{https://ctan.org/pkg/iexec}{doi} package,
+% It is also recommended to use the \href{https://ctan.org/pkg/doi}{doi} package,
 % in order to make all ``|doi|'' fields turned into hyper links.
 
 % \DescribeMacro{caps}
@@ -225,7 +225,7 @@
 %</verb>
 %\fi
 % When first names are shortened to a single letter, it has to have a tailing dot.
-% A specially pronounced author may be wrapped it in curled brackets, to make Bibcop ignore it:
+% A specially pronounced author may be wrapped in curled brackets, to make Bibcop ignore it:
 %\iffalse
 %<*verb>
 %\fi
@@ -444,7 +444,7 @@
   \iexec[maybe]{\bibcop at script\space
     \ifdefined\bibcop at verbose--verbose\fi\space
     \ifdefined\bibcop at notags--no:tags\fi\space
-    \ifdefined\bibcop at noinproc--no:org\fi\space
+    \ifdefined\bibcop at noorg--no:org\fi\space
     \ifdefined\bibcop at noinproc--no:inproc\fi\space
     \ifdefined\bibcop at nodoi--no:doi\fi\space
     \ifdefined\bibcop at nocaps--no:caps\fi\space

Modified: trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty	2025-03-12 19:34:37 UTC (rev 74592)
+++ trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty	2025-03-12 19:34:53 UTC (rev 74593)
@@ -31,7 +31,7 @@
 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{bibcop}
-[2025/03/10 0.0.30 Style Checker of Bibliography Files]
+[2025/03/12 0.0.31 Style Checker of Bibliography Files]
 
 
 
@@ -94,7 +94,7 @@
   \iexec[maybe]{\bibcop at script\space
     \ifdefined\bibcop at verbose--verbose\fi\space
     \ifdefined\bibcop at notags--no:tags\fi\space
-    \ifdefined\bibcop at noinproc--no:org\fi\space
+    \ifdefined\bibcop at noorg--no:org\fi\space
     \ifdefined\bibcop at noinproc--no:inproc\fi\space
     \ifdefined\bibcop at nodoi--no:doi\fi\space
     \ifdefined\bibcop at nocaps--no:caps\fi\space



More information about the tex-live-commits mailing list.