Skip to content

Commit

Permalink
#101 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed May 3, 2024
1 parent 4dadb45 commit cb00af1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bibcop.pl
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ sub entries {
sub only_words {
my ($tex) = @_;
my $t = clean_tex($tex);
$t =~ s/([^a-zA-Z0-9\\])/ $1 /g;
$t =~ s/([^a-zA-Z0-9\\'])/ $1 /g;
$t =~ s/- +- +-/---/g;
$t =~ s/{ /{/g;
$t =~ s/ }/}/g;
Expand Down
3 changes: 3 additions & 0 deletions perl-tests/checks.pl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ package bibcop;
check_passes($f, ('title' => 'An Empirical Study of in C Code From GitHub'));
check_passes($f, ('title' => 'GitHub Audience?---A Thematic Analysis'));
check_passes($f, ('title' => 'Analysis of {GitHub.com} Users'));
check_passes($f, ('title' => 'Don\'t Read'));
check_passes($f, ('title' => 'We\'ve Done It'));
check_passes($f, ('title' => 'Developer\'s Story'));

$f = 'check_year';
check_fails($f, ('year' => 'hello'));
Expand Down
1 change: 1 addition & 0 deletions perl-tests/fixing.pl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ package bibcop;
fixes('title', 'does it work?---of course!', 'Does It Work?---Of Course!');
fixes('title', 'GitHub Audience?---a Thematic Analysis', 'GitHub Audience?---A Thematic Analysis');
fixes('title', 'our in-house rules', 'Our In-House Rules');
fixes('title', 'user\'s story', 'User\'s Story');

fixes('booktitle', 'Proceedings Of IEEE Symposium On Art', 'Proceedings of Symposium on Art');
fixes('booktitle', 'Symposium on Computers', 'Proceedings of the Symposium on Computers');
Expand Down
3 changes: 1 addition & 2 deletions testfiles/bibtex.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ LaTeX Warning: Citation `dijkstra1968letters' on page 1 undefined on input line
runsystem((perl ./bibcop.pl --verbose --latex 'main.bib') > iexec.tmp 2>&1; /bin/echo -n $?% >iexec.ret)...executed.
(iexec.tmp bibcop: 1 entries found in main.bib
bibcop: Checking dijkstra1968letters (no.0)...
Package bibcop Warning: All minor words in the 'title' must be lower-cased, while the 6th word 'To' is not, in the 'dijkstra1968letters' entry.
Package bibcop Warning: A mandatory 'doi' tag for '@article' is missing among (author, journal, number, pages, publisher, title, volume, year), in the 'dijkstra1968letters' entry.
Package bibcop Warning: The 'title' must be wrapped in double curled brackets, in the 'dijkstra1968letters' entry.
bibcop: 3 problem(s) found
bibcop: 2 problem(s) found
) iexec: The content of 'iexec.tmp' was included into the document
runsystem(rm iexec.tmp)...executed.
runsystem(rm iexec.ret)...executed.
Expand Down
3 changes: 1 addition & 2 deletions testfiles/bibtex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ LaTeX Warning: Citation `dijkstra1968letters' on page 1 undefined on input line
runsystem((perl ./bibcop.pl --verbose --latex 'main.bib') > iexec.tmp 2>&1; /bin/echo -n $?% >iexec.ret)...executed.
(iexec.tmp bibcop: 1 entries found in main.bib
bibcop: Checking dijkstra1968letters (no.0)...
Package bibcop Warning: All minor words in the 'title' must be lower-cased, while the 6th word 'To' is not, in the 'dijkstra1968letters' entry.
Package bibcop Warning: A mandatory 'doi' tag for '@article' is missing among (author, journal, number, pages, publisher, title, volume, year), in the 'dijkstra1968letters' entry.
Package bibcop Warning: The 'title' must be wrapped in double curled brackets, in the 'dijkstra1968letters' entry.
bibcop: 3 problem(s) found
bibcop: 2 problem(s) found
) iexec: The content of 'iexec.tmp' was included into the document
runsystem(rm iexec.tmp)...executed.
runsystem(rm iexec.ret)...executed.
Expand Down
3 changes: 1 addition & 2 deletions testfiles/bibtex.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ LaTeX Warning: Citation `dijkstra1968letters' on page 1 undefined on input line
runsystem((perl ./bibcop.pl --verbose --latex 'main.bib') > iexec.tmp 2>&1; /bin/echo -n $?% >iexec.ret)...executed.
(iexec.tmp bibcop: 1 entries found in main.bib
bibcop: Checking dijkstra1968letters (no.0)...
Package bibcop Warning: All minor words in the 'title' must be lower-cased, while the 6th word 'To' is not, in the 'dijkstra1968letters' entry.
Package bibcop Warning: A mandatory 'doi' tag for '@article' is missing among (author, journal, number, pages, publisher, title, volume, year), in the 'dijkstra1968letters' entry.
Package bibcop Warning: The 'title' must be wrapped in double curled brackets, in the 'dijkstra1968letters' entry.
bibcop: 3 problem(s) found
bibcop: 2 problem(s) found
) iexec: The content of 'iexec.tmp' was included into the document
runsystem(rm iexec.tmp)...executed.
runsystem(rm iexec.ret)...executed.
Expand Down
2 changes: 1 addition & 1 deletion testfiles/support/main.bib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@article{dijkstra1968letters,
title={Letters to the Editor: Go To Statement Considered Harmful},
title={Letters to the Editor: {Go To} Statement Considered Harmful},
author={Dijkstra, Edsger W.},
journal={Communications of the ACM},
volume={11},
Expand Down

0 comments on commit cb00af1

Please sign in to comment.