texlive[74561] trunk: bibcop (10mar25)
commits+karl at tug.org
commits+karl at tug.org
Mon Mar 10 21:07:28 CET 2025
Revision: 74561
https://tug.org/svn/texlive?view=revision&revision=74561
Author: karl
Date: 2025-03-10 21:07:28 +0100 (Mon, 10 Mar 2025)
Log Message:
-----------
bibcop (10mar25)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/bibcop/bibcop.pl
trunk/Master/texmf-dist/doc/bibtex/bibcop/README.md
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/source/bibtex/bibcop/bibcop.ins
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-10 20:06:47 UTC (rev 74560)
+++ trunk/Build/source/texk/texlive/linked_scripts/bibcop/bibcop.pl 2025-03-10 20:07:28 UTC (rev 74561)
@@ -1,27 +1,8 @@
#!/usr/bin/perl
-# (The MIT License)
-#
-# Copyright (c) 2022-2025 Yegor Bugayenko
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the 'Software'), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
+# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
+# SPDX-License-Identifier: MIT
-# 2025/01/22 0.0.25
+# 2025/03/10 0.0.30
package bibcop;
use warnings;
@@ -169,7 +150,7 @@
if ($name =~ /^[A-Z][^.]+$/) {
next
}
- if ($name =~ /^(van|de|der|dos)$/) {
+ if ($name =~ /^(van|de|der|dos|von)$/) {
next
}
if ($name =~ /^[A-Z]$/) {
@@ -268,7 +249,7 @@
}
}
if ($title =~ /^.*(ACM|IEEE).*$/) {
- return "Don't mention the"
+ return "Don't mention the organization in the booktitle, use 'publisher' tag instead"
}
}
}
@@ -314,8 +295,8 @@
next;
}
my $good = 0;
- foreach my $s (@good_tails) {
- if ($value =~ /^.*\Q$s\E$/) {
+ foreach my $gt (@good_tails) {
+ if ($value =~ /^.*\Q$gt\E$/) {
$good = 1;
}
}
@@ -482,7 +463,7 @@
my (%entry) = @_;
if (exists $entry{'month'}) {
my $month = $entry{'month'};
- if (not $month =~ /^[1-9]|10|11|12|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec$/) {
+ if (not $month =~ /^[1-9]|10|11|12$/) {
return "The format of the 'month' is wrong"
}
}
@@ -1109,7 +1090,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.25 2025/01/22');
+ info('0.0.30 2025/03/10');
} else {
my ($file) = grep { not($_ =~ /^-.*$/) } @ARGV;
if (not $file) {
@@ -1130,6 +1111,8 @@
$fixed = $fixed . entry_fix(%entry);
$seen{$name} = 1;
}
+ my ($head) = $bib =~ /^((?:%.*\n)+\n*)/;
+ $fixed = $head . $fixed;
if (exists $args{'-i'} or exists $args{'--in-place'}) {
open(my $out, '>', $file) or error('Cannot open file for writing: ' . $file);
print $out $fixed;
Modified: trunk/Master/texmf-dist/doc/bibtex/bibcop/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/bibtex/bibcop/README.md 2025-03-10 20:06:47 UTC (rev 74560)
+++ trunk/Master/texmf-dist/doc/bibtex/bibcop/README.md 2025-03-10 20:07:28 UTC (rev 74561)
@@ -12,7 +12,7 @@
[biblatex-check](https://github.com/pezmc/biblatex-check) tools —
they do _almost_ the same but from the command line.
-Read [this blog post][BLOG],in order to understand
+Read [this blog post][BLOG], in order to understand
the motivation behind this package.
First, [install it][INSTALL] from [CTAN](https://ctan.org/pkg/bibcop)
@@ -64,10 +64,22 @@
necessity to mention Perl:
```bash
-tlgmr install bibcop
+tlmgr install bibcop
bibcop --help
```
+## How to use as pre-commit hook
+
+If you use [pre-commit], simply add this to your config:
+
+```yaml
+- repo: https://github.com/yegor256/bibcop
+ rev: 0.0.29
+ hooks:
+ - id: bibcop
+ args: []
+```
+
## How to Contribute
If you want to contribute yourself, make a fork, then create a branch,
@@ -91,3 +103,4 @@
[BLOG]: https://www.yegor256.com/2023/09/05/style-checker-for-bibtex-files.html
[INSTALL]: https://en.wikibooks.org/wiki/LaTeX/Installing_Extra_Packages
+[pre-commit]: https://pre-commit.com/
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-10 20:06:47 UTC (rev 74560)
+++ trunk/Master/texmf-dist/doc/man/man1/bibcop.1 2025-03-10 20:07:28 UTC (rev 74561)
@@ -1,4 +1,4 @@
-.TH bibcop 1 "2025/01/22"
+.TH bibcop 1 "2025/03/10"
.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-10 20:06:47 UTC (rev 74560)
+++ trunk/Master/texmf-dist/scripts/bibcop/bibcop.pl 2025-03-10 20:07:28 UTC (rev 74561)
@@ -1,27 +1,8 @@
#!/usr/bin/perl
-# (The MIT License)
-#
-# Copyright (c) 2022-2025 Yegor Bugayenko
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the 'Software'), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in all
-# copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-# SOFTWARE.
+# SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
+# SPDX-License-Identifier: MIT
-# 2025/01/22 0.0.25
+# 2025/03/10 0.0.30
package bibcop;
use warnings;
@@ -169,7 +150,7 @@
if ($name =~ /^[A-Z][^.]+$/) {
next
}
- if ($name =~ /^(van|de|der|dos)$/) {
+ if ($name =~ /^(van|de|der|dos|von)$/) {
next
}
if ($name =~ /^[A-Z]$/) {
@@ -268,7 +249,7 @@
}
}
if ($title =~ /^.*(ACM|IEEE).*$/) {
- return "Don't mention the"
+ return "Don't mention the organization in the booktitle, use 'publisher' tag instead"
}
}
}
@@ -314,8 +295,8 @@
next;
}
my $good = 0;
- foreach my $s (@good_tails) {
- if ($value =~ /^.*\Q$s\E$/) {
+ foreach my $gt (@good_tails) {
+ if ($value =~ /^.*\Q$gt\E$/) {
$good = 1;
}
}
@@ -482,7 +463,7 @@
my (%entry) = @_;
if (exists $entry{'month'}) {
my $month = $entry{'month'};
- if (not $month =~ /^[1-9]|10|11|12|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec$/) {
+ if (not $month =~ /^[1-9]|10|11|12$/) {
return "The format of the 'month' is wrong"
}
}
@@ -1109,7 +1090,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.25 2025/01/22');
+ info('0.0.30 2025/03/10');
} else {
my ($file) = grep { not($_ =~ /^-.*$/) } @ARGV;
if (not $file) {
@@ -1130,6 +1111,8 @@
$fixed = $fixed . entry_fix(%entry);
$seen{$name} = 1;
}
+ my ($head) = $bib =~ /^((?:%.*\n)+\n*)/;
+ $fixed = $head . $fixed;
if (exists $args{'-i'} or exists $args{'--in-place'}) {
open(my $out, '>', $file) or error('Cannot open file for writing: ' . $file);
print $out $fixed;
Modified: trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx
===================================================================
--- trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx 2025-03-10 20:06:47 UTC (rev 74560)
+++ trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.dtx 2025-03-10 20:07:28 UTC (rev 74561)
@@ -1,25 +1,6 @@
% \iffalse meta-comment
-% (The MIT License)
-%
-% Copyright (c) 2022-2025 Yegor Bugayenko
-%
-% Permission is hereby granted, free of charge, to any person obtaining a copy
-% of this software and associated documentation files (the 'Software'), to deal
-% in the Software without restriction, including without limitation the rights
-% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-% copies of the Software, and to permit persons to whom the Software is
-% furnished to do so, subject to the following conditions:
-%
-% The above copyright notice and this permission notice shall be included in all
-% copies or substantial portions of the Software.
-%
-% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-% SOFTWARE.
+% SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
+% SPDX-License-Identifier: MIT
% \fi
% \CheckSum{0}
@@ -50,7 +31,7 @@
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{bibcop}
%<*package>
-[2025/01/22 0.0.25 Style Checker of Bibliography Files]
+[2025/03/10 0.0.30 Style Checker of Bibliography Files]
%</package>
%<*driver>
\documentclass{ltxdoc}
@@ -175,8 +156,8 @@
% This is a more or less complete list of rules enforced on a |.bib| file:
% \DescribeMacro{types}
-% Only |@article|, |@book|, |@inproceedings|, and |@misc| types of \BibTeX{} entries are allowed.
-% Everything else, like |@manual|, |@phdthesis|, and many others are simply prohibited.
+% Only |@article|, |@book|, |@inproceedings|, |@phdthesis|, |@incollection|, and |@misc| types of \BibTeX{} entries are allowed.
+% Everything else, like |@manual|, |@inbook|, and \href{https://www.bibtex.com/e/entry-types/}{many others} are simply prohibited.
% The mentioned four should be enough for everything.
% \DescribeMacro{tags}
Modified: trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.ins
===================================================================
--- trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.ins 2025-03-10 20:06:47 UTC (rev 74560)
+++ trunk/Master/texmf-dist/source/bibtex/bibcop/bibcop.ins 2025-03-10 20:07:28 UTC (rev 74561)
@@ -1,24 +1,5 @@
-%% (The MIT License)
-%%
-%% Copyright (c) 2022-2025 Yegor Bugayenko
-%%
-%% Permission is hereby granted, free of charge, to any person obtaining a copy
-%% of this software and associated documentation files (the 'Software'), to deal
-%% in the Software without restriction, including without limitation the rights
-%% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-%% copies of the Software, and to permit persons to whom the Software is
-%% furnished to do so, subject to the following conditions:
-%%
-%% The above copyright notice and this permission notice shall be included in all
-%% copies or substantial portions of the Software.
-%%
-%% THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-%% SOFTWARE.
+%% SPDX-FileCopyrightText: Copyright (c) 2022-2025 Yegor Bugayenko
+%% SPDX-License-Identifier: MIT
\input docstrip.tex
\keepsilent
Modified: trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty 2025-03-10 20:06:47 UTC (rev 74560)
+++ trunk/Master/texmf-dist/tex/latex/bibcop/bibcop.sty 2025-03-10 20:07:28 UTC (rev 74561)
@@ -31,7 +31,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bibcop}
-[2025/01/22 0.0.25 Style Checker of Bibliography Files]
+[2025/03/10 0.0.30 Style Checker of Bibliography Files]
More information about the tex-live-commits
mailing list.