Skip to content

Commit

Permalink
do not report packages maintained by us but having their own reposito…
Browse files Browse the repository at this point in the history
…ry as "thrid-party"
  • Loading branch information
FrankMittelbach committed Aug 26, 2021
1 parent fb05224 commit c0c18bb
Show file tree
Hide file tree
Showing 17 changed files with 409 additions and 135 deletions.
6 changes: 6 additions & 0 deletions changes.txt
@@ -1,3 +1,9 @@
2021-08-26 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* latexbug.dtx:
Do not classify packages maintained by us (but in different
repositories) as third-party files.

2021-06-27 Frank Mittelbach <Frank.Mittelbach@latex-project.org>

* latexbug.dtx:
Expand Down
135 changes: 100 additions & 35 deletions latexbug.dtx
Expand Up @@ -105,8 +105,7 @@
%
% An error is generated if the test file makes use of third-party code
% that is not maintained by the \LaTeX{} Project Team. For example, if
% the file would load \texttt{geometry}, \texttt{footmisc} and
% \texttt{hyperref} you
% the file would load \texttt{geometry} and \texttt{footmisc} you
% would see the following:
% \begin{verbatim}
% Package latexbug Error: Third-party file(s)
Expand All @@ -117,8 +116,6 @@
% (latexbug) geometry.sty -> Hideo Umeki
% (latexbug) <latexgeometry [at] gmail [dot] com>
% (latexbug) footmisc.sty
% (latexbug) hyperref.sty -> LaTeX Team
% (latexbug) https://github.com/latex3/hyperref/issues
% (latexbug) ==============
% (latexbug)
% \end{verbatim}
Expand All @@ -137,7 +134,7 @@
% To make life somewhat easier \texttt{latexbug} will tell you the
% name of the maintainer (if we know it and have added it in) and if
% possible also the canonical bug address for the package (like in the
% case of \texttt{geometry} and \texttt{hyperref}).
% case of \texttt{geometry}).
% If we don't have that information, you
% need to find it out for yourself by looking at the package
% documentation.
Expand All @@ -158,6 +155,43 @@
%
% \vspace*{1ex}
%
% It is also possible that \texttt{latexbug} doesn't generate an
% error, but issues a warning, that it has detected one or more
% packages, that have their own bug tracker. In that case the report
% should be made in the bug tracker of that package and not in the
% \LaTeXe{}, even if it is a package that is mainted by us!
%
% Other people look these bug tracker to search for known problems and
% thus it is best if yours is recorded in the right place. Such a
% warning will look like this (we use \texttt{hyperref} as an
% example):
% \begin{verbatim}
% Package latexbug Warning: Special bug tracker!
% (latexbug)
% (latexbug) This test file uses the following file(s)
% (latexbug)
% (latexbug) ==============
% (latexbug) hyperref.sty -> Report at:
% (latexbug) https://github.com/latex3/hyperref/issues
% (latexbug) ==============
% (latexbug)
% (latexbug) Please note that these files have their own
% (latexbug) bug tracker and your issue should therefore
% (latexbug) be reported in the indicated repository.
% (latexbug)
% (latexbug) If the are not necessary to exhibit the problem,
% (latexbug) remove them from your example and rerun it,
% (latexbug) otherwise report the issue in the listed repository.
% (latexbug)
% (latexbug) If different repositories are listed, try to
% (latexbug) select the most appropriate one (but don't worry
% (latexbug) too much, if the choice is not clear to you).
% \end{verbatim}
%
%
%
% \vspace*{1ex}
%
% \begin{center}
% \fbox{\fbox{\parbox{.6\textwidth}{\itshape Thank you for taking
% the time to report a bug and prepare a test
Expand Down Expand Up @@ -231,7 +265,7 @@
% \begin{macrocode}
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{latexbug}[2021/06/28 v1.0k Bug-classification]
\ProvidesPackage{latexbug}[2021/08/26 v1.0l Bug-classification]
% \end{macrocode}
%
% \begin{macro}{\latexbug@empty}
Expand Down Expand Up @@ -268,17 +302,26 @@
% mapping. The trailing space is important (stripping it is not really worth
% it for this very limited use case).
% \begin{macrocode}
\long\def\latexbug@loop #1 = #2 , {% spaces matter
\global\@namedef{latexbug@@#1}{#2}%
\long\def\latexbug@loop #1 = #2 #3, {% spaces matter
\global\@namedef{latexbug@@#1}{{#2}{#3}}%
\ifx\latexbug@empty#1\else\expandafter\latexbug@loop\fi}
% \end{macrocode}
% \end{macro}
%
% A simple database of files. The value \texttt{us} means we accept
% bugs for it. We also take bug reports for \texttt{us*} (expl3) entries, but
% bugs for it. We also take bug reports for \texttt{us*}
% (expl3 or other repositories we suport) entries, but
% they need to go to a different GitHub repository, so are handled separately
% (and only show up
% if there doesn't seem to be anything else to pick up). A value of
% if there are no third-party packages).
% For the \texttt{latex3/latex3} repository just write \texttt{us*}, for others
% one need to specify the full details, e.g.,
%\begin{verbatim}
% hyperref.sty = us*
% \Contact https://github.com/latex3/hyperref/issues ,
%\end{verbatim}
%
% A value of
% \texttt{ignore} means that its not our code, but we understand that it may
% show up in legitimate test files and should therefore not trigger an error.
%
Expand All @@ -290,7 +333,8 @@
%
% \begin{quote} \itshape
% The database format is somewhat fragile: one needs to have a space on both sides
% of the equal sign (or one gets a nasty low-level error) and names can't have
% of the equal sign and before the comma (or one gets a nasty low-level error),
% and names can't have
% no-ascii characters in them, so they end up crippled (sorry for that).
% \end{quote}
%
Expand Down Expand Up @@ -806,7 +850,7 @@ hluatex.def = ignore ,
hpdftex.def = ignore ,
hxetex.def = ignore ,
hyperref.cfg = ignore ,
hyperref.sty = LaTeX Team
hyperref.sty = us*
\Contact https://github.com/latex3/hyperref/issues ,
hyperref-langpatches.def = ignore ,
pd1enc.def = ignore ,
Expand All @@ -832,7 +876,7 @@ siunitx.sty = Joseph Wright
%--------------------------------- babel external
basque.ldf = Juan M. Aguirregabiria
\Contact <http://tp.lc.ehu.es/jma.html> ,
belarusian.ldf = Aleksey Novodvorsky, Andrew Shadura
belarusian.ldf = Aleksey Novodvorsky and Andrew Shadura
\Contact <andrew [at] shadura [dot] me> ,
bosnian.ldf = Samir Halilcevic %% Halilčević
\Contact <samir [dot] halilcevic [at] fet [dot] ba> ,
Expand Down Expand Up @@ -915,11 +959,11 @@ vietnamese.ldf = Werner Lemberg
% \end{macro}
%
% \begin{macro}{\latexbug@zzzz}
% \begin{macro}{\latexbug@expl}
% \begin{macro}{\latexbug@own}
% Storage for third-party files and those from the \LaTeX3 set on GitHub.
% \begin{macrocode}
\def\latexbug@zzzz{}
\def\latexbug@expl{}
\def\latexbug@own{}
% \end{macrocode}
% \end{macro}
% \end{macro}
Expand All @@ -928,33 +972,37 @@ vietnamese.ldf = Werner Lemberg
% \begin{macro}{\process@table}
% A hook into a convenient place in the document set up: the
% initialization of NFSS during the \cs{document} macro. If either
% \cs{latexbug@zzzz} or \cs{latexbug@expl} have any content then there is
% \cs{latexbug@zzzz} or \cs{latexbug@own} have any content then there is
% a message to issue, it's just a question of deciding which one.
% \begin{macrocode}
\let\latexbug@process@table\process@table
\def\process@table{\global\let\@addtofilelist\latexbug@addtofilelist
\latexbug@process@table
\ifx\latexbug@zzzz\latexbug@empty
\ifx\latexbug@expl\latexbug@empty
\ifx\latexbug@own\latexbug@empty
\else
\PackageError{latexbug}%
{LaTeX3 file(s)\MessageBreak
\typeout{}%
\PackageWarningNoLine{latexbug}%
{Special bug tracker!\MessageBreak
\MessageBreak
This test files uses the LaTeX3 file(s)\MessageBreak
This test file uses the following file(s)\MessageBreak
\MessageBreak
==============\MessageBreak
\latexbug@expl
\latexbug@own
==============\MessageBreak
\MessageBreak
You should report bugs in these packages\MessageBreak
at the LaTeX3 GitHub site,\MessageBreak
https://github.com/latex3/latex3/issues\MessageBreak
(Or remove them from your example,\MessageBreak
if they are not necessary to\MessageBreak
exhibit the problem).\MessageBreak
}{Please correct your test file prior
to submitting the bug report.\MessageBreak
Otherwise it is likely to be rejected!}%
Please note that these files have their own\MessageBreak
bug tracker and your issue should therefore\MessageBreak
be reported in the indicated repository.\MessageBreak
\MessageBreak
If the are not necessary to exhibit the problem,\MessageBreak
remove them from your example and rerun it,\MessageBreak
otherwise report the issue in the listed repository.\MessageBreak
\MessageBreak
If different repositories are listed, try to\MessageBreak
select the most appropriate one (but don't worry\MessageBreak
too much, if the choice is not clear to you)}%
\typeout{}%
\fi
\else
\PackageError{latexbug}%
Expand Down Expand Up @@ -998,22 +1046,37 @@ this explicitly in your bug report\MessageBreak
% later.
% \begin{macrocode}
\def\@addtofilelist#1{%
% \show\@currnamestack
\expandafter\latexbug@iftoplevel\@currnamestack {}\@nil
\begingroup
\xdef\latexbug@x{#1}% TODO: one-level sanitize
\expandafter
\ifx\csname latexbug@@\latexbug@x\endcsname\relax
\def\latexbug@y{}%
\else
\xdef\latexbug@y{\csname latexbug@@\latexbug@x\endcsname}%
% \end{macrocode}
% \cs{latexbug@y} will contain either on of the keywords
% \texttt{us} or \texttt{us*} or \texttt{ignore} or it will contain
% the start part of the third-party information, \cs{latexbug@z}
% contains the rest (if anything), the space between the two is
% lost and needs to be reinserted.
% \begin{macrocode}
\xdef\latexbug@y{\expandafter\expandafter\expandafter
\@firstoftwo\csname latexbug@@\latexbug@x\endcsname}%
\xdef\latexbug@z{\expandafter\expandafter\expandafter
\@secondoftwo\csname latexbug@@\latexbug@x\endcsname}%
\fi
\ifx\latexbug@y\latexbug@us\else
\ifx\latexbug@y\latexbug@usstar
\begingroup
\let\MessageBreak\relax
\xdef\latexbug@expl{%
\latexbug@expl\latexbug@x
\xdef\latexbug@own{%
\latexbug@own\latexbug@x
\space\space -> \space Report at:
\ifx\latexbug@z\@empty
\Contact https://github.com/latex3/latex3/issues
\else
\latexbug@z
\fi
\MessageBreak
}%
\endgroup
Expand All @@ -1022,7 +1085,9 @@ this explicitly in your bug report\MessageBreak
{\let\MessageBreak\relax
\xdef\latexbug@zzzz{\latexbug@zzzz\latexbug@x
\ifx\latexbug@y\latexbug@empty\else
\space\space -> \space \latexbug@y\fi
\space\space -> \space \latexbug@y
\space \latexbug@z
\fi
\MessageBreak}}%
\fi
\fi
Expand Down
63 changes: 39 additions & 24 deletions latexbug.sty
Expand Up @@ -30,15 +30,15 @@
%% version 2005/12/01 or later.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{latexbug}[2021/06/28 v1.0k Bug-classification]
\ProvidesPackage{latexbug}[2021/08/26 v1.0l Bug-classification]
\def\latexbug@empty{}
\def\latexbug@us{us}
\def\latexbug@usstar{us*}
\def\latexbug@ignore{ignore}
\def\Contact{\MessageBreak \@spaces}
\begingroup
\long\def\latexbug@loop #1 = #2 , {% spaces matter
\global\@namedef{latexbug@@#1}{#2}%
\long\def\latexbug@loop #1 = #2 #3, {% spaces matter
\global\@namedef{latexbug@@#1}{{#2}{#3}}%
\ifx\latexbug@empty#1\else\expandafter\latexbug@loop\fi}
\latexbug@loop
latexbug.sty = us ,
Expand Down Expand Up @@ -536,7 +536,7 @@ hluatex.def = ignore ,
hpdftex.def = ignore ,
hxetex.def = ignore ,
hyperref.cfg = ignore ,
hyperref.sty = LaTeX Team
hyperref.sty = us*
\Contact https://github.com/latex3/hyperref/issues ,
hyperref-langpatches.def = ignore ,
pd1enc.def = ignore ,
Expand All @@ -558,7 +558,7 @@ siunitx.sty = Joseph Wright
\Contact https://github.com/josephwright/siunitx/issues ,
basque.ldf = Juan M. Aguirregabiria
\Contact <http://tp.lc.ehu.es/jma.html> ,
belarusian.ldf = Aleksey Novodvorsky, Andrew Shadura
belarusian.ldf = Aleksey Novodvorsky and Andrew Shadura
\Contact <andrew [at] shadura [dot] me> ,
bosnian.ldf = Samir Halilcevic %% Halilčević
\Contact <samir [dot] halilcevic [at] fet [dot] ba> ,
Expand Down Expand Up @@ -628,31 +628,35 @@ vietnamese.ldf = Werner Lemberg
\endgroup
\let\latexbug@addtofilelist\@addtofilelist
\def\latexbug@zzzz{}
\def\latexbug@expl{}
\def\latexbug@own{}
\let\latexbug@process@table\process@table
\def\process@table{\global\let\@addtofilelist\latexbug@addtofilelist
\latexbug@process@table
\ifx\latexbug@zzzz\latexbug@empty
\ifx\latexbug@expl\latexbug@empty
\ifx\latexbug@own\latexbug@empty
\else
\PackageError{latexbug}%
{LaTeX3 file(s)\MessageBreak
\typeout{}%
\PackageWarningNoLine{latexbug}%
{Special bug tracker!\MessageBreak
\MessageBreak
This test files uses the LaTeX3 file(s)\MessageBreak
This test file uses the following file(s)\MessageBreak
\MessageBreak
==============\MessageBreak
\latexbug@expl
\latexbug@own
==============\MessageBreak
\MessageBreak
You should report bugs in these packages\MessageBreak
at the LaTeX3 GitHub site,\MessageBreak
https://github.com/latex3/latex3/issues\MessageBreak
(Or remove them from your example,\MessageBreak
if they are not necessary to\MessageBreak
exhibit the problem).\MessageBreak
}{Please correct your test file prior
to submitting the bug report.\MessageBreak
Otherwise it is likely to be rejected!}%
Please note that these files have their own\MessageBreak
bug tracker and your issue should therefore\MessageBreak
be reported in the indicated repository.\MessageBreak
\MessageBreak
If the are not necessary to exhibit the problem,\MessageBreak
remove them from your example and rerun it,\MessageBreak
otherwise report the issue in the listed repository.\MessageBreak
\MessageBreak
If different repositories are listed, try to\MessageBreak
select the most appropriate one (but don't worry\MessageBreak
too much, if the choice is not clear to you)}%
\typeout{}%
\fi
\else
\PackageError{latexbug}%
Expand Down Expand Up @@ -689,14 +693,23 @@ this explicitly in your bug report\MessageBreak
\ifx\csname latexbug@@\latexbug@x\endcsname\relax
\def\latexbug@y{}%
\else
\xdef\latexbug@y{\csname latexbug@@\latexbug@x\endcsname}%
\xdef\latexbug@y{\expandafter\expandafter\expandafter
\@firstoftwo\csname latexbug@@\latexbug@x\endcsname}%
\xdef\latexbug@z{\expandafter\expandafter\expandafter
\@secondoftwo\csname latexbug@@\latexbug@x\endcsname}%
\fi
\ifx\latexbug@y\latexbug@us\else
\ifx\latexbug@y\latexbug@usstar
\begingroup
\let\MessageBreak\relax
\xdef\latexbug@expl{%
\latexbug@expl\latexbug@x
\xdef\latexbug@own{%
\latexbug@own\latexbug@x
\space\space -> \space Report at:
\ifx\latexbug@z\@empty
\Contact https://github.com/latex3/latex3/issues
\else
\latexbug@z
\fi
\MessageBreak
}%
\endgroup
Expand All @@ -705,7 +718,9 @@ this explicitly in your bug report\MessageBreak
{\let\MessageBreak\relax
\xdef\latexbug@zzzz{\latexbug@zzzz\latexbug@x
\ifx\latexbug@y\latexbug@empty\else
\space\space -> \space \latexbug@y\fi
\space\space -> \space \latexbug@y
\space \latexbug@z
\fi
\MessageBreak}}%
\fi
\fi
Expand Down

0 comments on commit c0c18bb

Please sign in to comment.