Re: [PATCH] Add TREAT_WARNINGS_AS_ERROR option

Albert <[email protected]> Wed, 9 Dec 2015 19:33:08 +0100
Newsgroups gmane.text.doxygen.devel
Message-ID <CABOOx7YC=vjtdu2c5PnMVipeaNUJJfJfGLwYVZ-F1TpCWBiWJA@mail.gmail.com>
--===============4112308624336396442==
Content-Type: multipart/alternative; boundary=001a114a847c63a79805267b52a4

--001a114a847c63a79805267b52a4
Content-Type: text/plain; charset=UTF-8

Hi Gautier,

Thanks for you responses to my suggestions.
1) continuation on errors.
   In principle I think you are right, though the word error has a higher
"visibility" than warning. An example where an error is given but the
process continues is when the image from the PROJECT_LOGO does not exist.
This significantly influences the output.
   So maybe either we should have some more categories:
   - fatal same as current error ans stop generation (will break some
builds as some people , I do it myself, search for the word 'error' at the
beginning of the sentence
   - error same as current error, but process is continuing
   - warning as it is now
2) extra exit code for warnings
   I see you objection that it possibly will break, from the compatibility
point of view is probably a less good idea
3) Proposed patch does stop at first warning, my idea was more replacing
the word "warning" by "error" for higher "visibility".
4) giving warnings and errors a number
   we agree on this
5) inspecting the warnings.log file
   I think in any case one uses a build system to build the code and in one
way or another the build errors will be reported as well., possibly by an
external tool as well.
   Checking the warnings.log file would only be a test whether or not the
warnings file is empty or not, displaying the warnings and abort the build
process. So I don't see this as a big problem all build systems will
support something like this.

Albert



On Tue, Dec 8, 2015 at 10:35 AM, Gautier Pelloux-Prayer <[email protected]>
wrote:

> Hi Albert,
>
> Thanks for your detailled opinion. Please see my inlined remarks below.
>
> Gautier
>
> > On 06 Dec 2015, at 12:03, Albert <[email protected]> wrote:
> >
> > In principle all the errors and warnings doxygen gives should be removed
> by the engineers.
> >
> > Doxygen distinguish between errors and warnings, where errors possibly
> corrupt the documentation building or are serious enough, in the eyes of
> the doxygen developers to stop the generation of the documentation. In case
> of an error the doxygen developer can also choose to give an error message
> but to continue anyway.
> Should not it be a warning then? An error should have a consistent
> behavior during all processing, should it not?
> >
> > When we would have the possibility to promote all the warnings to errors
> (and we should also stop at all errors that currently don't stop), it would
> mean that, when using the option, after each error a rerun is necessary. I
> think this is a bit overdone.
> Well, that's the current behavior of -Werror for compilers. Indeed on
> first execution you will have a lot of stop&retry, but once it is done, you
> should not have many errors. And on first execution, you can temporary use
> -Wno-error to see all errors immediately if needed.
> > I see some possibilities:
> > - in case doxygen discovers warnings it does not finish with exit code 0
> but with e.g. exit code 2 (and use exit code 1 for the errors on which it
> now already stops).
> This solution suits me but if that possibility is adopted it might break
> many build systems where doxygen is expected to exit successfully in any
> case. Would it be a problem?
> > - when using the proposed option the message is given as an error, but
> the process does not stop. I don't see this as an improvement as one can
> now catch the warnings in a log file and check them.
> I am not sure to understand what do you mean there - proposed patch should
> exit on first warning?
> > - all warnings get a number and the user can "promote" in the Doxyfile
> some warnings to, fatal, errors. This would be quite a big effort as all
> the messages have to be categorized (I've been thinking about this some
> time ago, but have not started to implement this as it is a lot of work and
> does not bring enough in my opinion, a quick estimation 700 messages to be
> checked).
> Well, I agree with you that it would be both an ideal solution and a big
> effort which does not bring enough ;-).
> >
> > The procedure I follow more or less is: Each time I'm building
> (overnight builds) the software I catch the warnings and errors in a
> warnings.log file. When this warnings.log file contains a message (or a new
> message compared to the last time the build was done) an email is send to
> the engineer who, last. changed the source file.
> That's the step I want to avoid: having an external script/tool checking
> doxygen output to see if anything went wrong, while doxygen could tell me
> directly if I broke something. However this is more or less what I am
> aiming for.
> >
> >
> > Albert
> >
> > On Thu, Dec 3, 2015 at 9:34 PM, Gautier <[email protected]> wrote:
> > Hi list;
> >
> > As stated on Github[1], I would like to add an option behaving similarly
> > to compilers' -Werror option: any warning generated during Doxygen
> > execution will abort it immediately.
> >
> > This option is, in my opinion, valuable to keep documentation up-to-date
> > with code changes, specially when multiple people are working altogether.
> > I will not blame anyone to not think all consequence of a code change,
> > but scripts can help him/her from breaking anything:
> >
> > * strict compiler options (-Werror, -Wall, etc.) prevents at least some
> > quick&dirty code and obvious bugs. Compilers will warn beginners about
> > code which will not work (out of bounds errors, etc.), but most of the
> > time it's simply about a typo / useless dead code.
> > * Git hook preventing users from pushing invalid commits [2]. We are
> > intensively using git submodules for instance - it's quite easy to push
> > an invalid submodule reference to git:
> >      * if you forgot to run "git submodule update --recursive" after
> > pulling remote changes following by a "git commit -a", leading to
> > unwilling submodule downgrading.
> >      * if you're referencing a new submodule revision... which you
> > forgot to push first!
> > * To have better code consistency, following a single code style using
> > clang-format[3], similarly to what systemd does[4].
> >
> > I think that all of us already encountered one or several of these
> > issues at least once ;-). Having tools checking these errors
> > automatically allow me not to worry about it anymore.
> > Our documentation contains nowadays many errors simply because Doxygen
> > let us do that and we did not look at """inoffensive""" warnings, since
> > they are not preventing us from continuing - they are lost in the
> > verbosity of build logs.
> >
> > I am the only one which would like such an option, and if so: how do you
> > keep your documentation up-to-date?
> >
> > Cheers,
> >
> > Gautier
> >
> > [1] https://github.com/doxygen/doxygen/pull/412
> > [2] https://gist.github.com/bagage/bdca3d4b66d43db7a5e3
> > [3] http://clang.llvm.org/docs/ClangFormat.html
> > [4] https://github.com/systemd/systemd/blob/master/autogen.sh
> >
> >
> ------------------------------------------------------------------------------
> > Go from Idea to Many App Stores Faster with Intel(R) XDK
> > Give your users amazing mobile app experiences with Intel(R) XDK.
> > Use one codebase in this all-in-one HTML5 development environment.
> > Design, debug & build mobile apps & 2D/3D high-impact games for multiple
> OSs.
> > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
> > _______________________________________________
> > Doxygen-develop mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/doxygen-develop
> >
>
>

--001a114a847c63a79805267b52a4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Gautier,<br><br>Thanks for you responses to my suggesti=
ons.<br>1) continuation on errors.<br>=C2=A0=C2=A0 In principle I think you=
 are right, though the word error has a higher &quot;visibility&quot; than =
warning. An example where an error is given but the process continues is wh=
en the image from the PROJECT_LOGO does not exist. This significantly influ=
ences the output.<br>=C2=A0=C2=A0 So maybe either we should have some more =
categories:<br>=C2=A0=C2=A0 - fatal same as current error ans stop generati=
on (will break some builds as some people , I do it myself, search for the =
word &#39;error&#39; at the beginning of the sentence<br>=C2=A0=C2=A0 - err=
or same as current error, but process is continuing<br>=C2=A0=C2=A0 - warni=
ng as it is now<br>2) extra exit code for warnings<br>=C2=A0=C2=A0 I see yo=
u objection that it possibly will break, from the compatibility point of vi=
ew is probably a less good idea<br>3) Proposed patch does stop at first war=
ning, my idea was more replacing the word &quot;warning&quot; by &quot;erro=
r&quot; for higher &quot;visibility&quot;.<br>4) giving warnings and errors=
 a number<br>=C2=A0=C2=A0 we agree on this<br>5) inspecting the warnings.lo=
g file<br>=C2=A0=C2=A0 I think in any case one uses a build system to build=
 the code and in one way or another the build errors will be reported as we=
ll., possibly by an external tool as well.<br>=C2=A0=C2=A0 Checking the war=
nings.log file would only be a test whether or not the warnings file is emp=
ty or not, displaying the warnings and abort the build process. So I don&#3=
9;t see this as a big problem all build systems will support something like=
 this.<br><br>Albert<br><br><br></div><div class=3D"gmail_extra"><br><div c=
lass=3D"gmail_quote">On Tue, Dec 8, 2015 at 10:35 AM, Gautier Pelloux-Praye=
r <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x">Hi Albert,<br>
<br>
Thanks for your detailled opinion. Please see my inlined remarks below.<br>
<br>
Gautier<br>
<span class=3D""><br>
&gt; On 06 Dec 2015, at 12:03, Albert &lt;<a href=3D"mailto:albert.tests@gm=
ail.com">[email protected]</a>&gt; wrote:<br>
&gt;<br>
&gt; In principle all the errors and warnings doxygen gives should be remov=
ed by the engineers.<br>
&gt;<br>
&gt; Doxygen distinguish between errors and warnings, where errors possibly=
 corrupt the documentation building or are serious enough, in the eyes of t=
he doxygen developers to stop the generation of the documentation. In case =
of an error the doxygen developer can also choose to give an error message =
but to continue anyway.<br>
</span>Should not it be a warning then? An error should have a consistent b=
ehavior during all processing, should it not?<br>
<span class=3D"">&gt;<br>
&gt; When we would have the possibility to promote all the warnings to erro=
rs (and we should also stop at all errors that currently don&#39;t stop), i=
t would mean that, when using the option, after each error a rerun is neces=
sary. I think this is a bit overdone.<br>
</span>Well, that&#39;s the current behavior of -Werror for compilers. Inde=
ed on first execution you will have a lot of stop&amp;retry, but once it is=
 done, you should not have many errors. And on first execution, you can tem=
porary use -Wno-error to see all errors immediately if needed.<br>
<span class=3D"">&gt; I see some possibilities:<br>
&gt; - in case doxygen discovers warnings it does not finish with exit code=
 0 but with e.g. exit code 2 (and use exit code 1 for the errors on which i=
t now already stops).<br>
</span>This solution suits me but if that possibility is adopted it might b=
reak many build systems where doxygen is expected to exit successfully in a=
ny case. Would it be a problem?<br>
<span class=3D"">&gt; - when using the proposed option the message is given=
 as an error, but the process does not stop. I don&#39;t see this as an imp=
rovement as one can now catch the warnings in a log file and check them.<br=
>
</span>I am not sure to understand what do you mean there - proposed patch =
should exit on first warning?<br>
<span class=3D"">&gt; - all warnings get a number and the user can &quot;pr=
omote&quot; in the Doxyfile some warnings to, fatal, errors. This would be =
quite a big effort as all the messages have to be categorized (I&#39;ve bee=
n thinking about this some time ago, but have not started to implement this=
 as it is a lot of work and does not bring enough in my opinion, a quick es=
timation 700 messages to be checked).<br>
</span>Well, I agree with you that it would be both an ideal solution and a=
 big effort which does not bring enough ;-).<br>
<span class=3D"">&gt;<br>
&gt; The procedure I follow more or less is: Each time I&#39;m building (ov=
ernight builds) the software I catch the warnings and errors in a warnings.=
log file. When this warnings.log file contains a message (or a new message =
compared to the last time the build was done) an email is send to the engin=
eer who, last. changed the source file.<br>
</span>That&#39;s the step I want to avoid: having an external script/tool =
checking doxygen output to see if anything went wrong, while doxygen could =
tell me directly if I broke something. However this is more or less what I =
am aiming for.<br>
<div class=3D"HOEnZb"><div class=3D"h5">&gt;<br>
&gt;<br>
&gt; Albert<br>
&gt;<br>
&gt; On Thu, Dec 3, 2015 at 9:34 PM, Gautier &lt;<a href=3D"mailto:gautier@=
damsy.net">[email protected]</a>&gt; wrote:<br>
&gt; Hi list;<br>
&gt;<br>
&gt; As stated on Github[1], I would like to add an option behaving similar=
ly<br>
&gt; to compilers&#39; -Werror option: any warning generated during Doxygen=
<br>
&gt; execution will abort it immediately.<br>
&gt;<br>
&gt; This option is, in my opinion, valuable to keep documentation up-to-da=
te<br>
&gt; with code changes, specially when multiple people are working altogeth=
er.<br>
&gt; I will not blame anyone to not think all consequence of a code change,=
<br>
&gt; but scripts can help him/her from breaking anything:<br>
&gt;<br>
&gt; * strict compiler options (-Werror, -Wall, etc.) prevents at least som=
e<br>
&gt; quick&amp;dirty code and obvious bugs. Compilers will warn beginners a=
bout<br>
&gt; code which will not work (out of bounds errors, etc.), but most of the=
<br>
&gt; time it&#39;s simply about a typo / useless dead code.<br>
&gt; * Git hook preventing users from pushing invalid commits [2]. We are<b=
r>
&gt; intensively using git submodules for instance - it&#39;s quite easy to=
 push<br>
&gt; an invalid submodule reference to git:<br>
&gt;=C2=A0 =C2=A0 =C2=A0 * if you forgot to run &quot;git submodule update =
--recursive&quot; after<br>
&gt; pulling remote changes following by a &quot;git commit -a&quot;, leadi=
ng to<br>
&gt; unwilling submodule downgrading.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 * if you&#39;re referencing a new submodule revisi=
on... which you<br>
&gt; forgot to push first!<br>
&gt; * To have better code consistency, following a single code style using=
<br>
&gt; clang-format[3], similarly to what systemd does[4].<br>
&gt;<br>
&gt; I think that all of us already encountered one or several of these<br>
&gt; issues at least once ;-). Having tools checking these errors<br>
&gt; automatically allow me not to worry about it anymore.<br>
&gt; Our documentation contains nowadays many errors simply because Doxygen=
<br>
&gt; let us do that and we did not look at &quot;&quot;&quot;inoffensive&qu=
ot;&quot;&quot; warnings, since<br>
&gt; they are not preventing us from continuing - they are lost in the<br>
&gt; verbosity of build logs.<br>
&gt;<br>
&gt; I am the only one which would like such an option, and if so: how do y=
ou<br>
&gt; keep your documentation up-to-date?<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; Gautier<br>
&gt;<br>
&gt; [1] <a href=3D"https://github.com/doxygen/doxygen/pull/412" rel=3D"nor=
eferrer" target=3D"_blank">https://github.com/doxygen/doxygen/pull/412</a><=
br>
&gt; [2] <a href=3D"https://gist.github.com/bagage/bdca3d4b66d43db7a5e3" re=
l=3D"noreferrer" target=3D"_blank">https://gist.github.com/bagage/bdca3d4b6=
6d43db7a5e3</a><br>
&gt; [3] <a href=3D"http://clang.llvm.org/docs/ClangFormat.html" rel=3D"nor=
eferrer" target=3D"_blank">http://clang.llvm.org/docs/ClangFormat.html</a><=
br>
&gt; [4] <a href=3D"https://github.com/systemd/systemd/blob/master/autogen.=
sh" rel=3D"noreferrer" target=3D"_blank">https://github.com/systemd/systemd=
/blob/master/autogen.sh</a><br>
&gt;<br>
&gt; ----------------------------------------------------------------------=
--------<br>
&gt; Go from Idea to Many App Stores Faster with Intel(R) XDK<br>
&gt; Give your users amazing mobile app experiences with Intel(R) XDK.<br>
&gt; Use one codebase in this all-in-one HTML5 development environment.<br>
&gt; Design, debug &amp; build mobile apps &amp; 2D/3D high-impact games fo=
r multiple OSs.<br>
&gt; <a href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D254741911&a=
mp;iu=3D/4140" rel=3D"noreferrer" target=3D"_blank">http://pubads.g.doublec=
lick.net/gampad/clk?id=3D254741911&amp;iu=3D/4140</a><br>
&gt; _______________________________________________<br>
&gt; Doxygen-develop mailing list<br>
&gt; <a href=3D"mailto:[email protected]">Doxygen-devel=
[email protected]</a><br>
&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/doxygen-develo=
p" rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists=
/listinfo/doxygen-develop</a><br>
&gt;<br>
<br>
</div></div></blockquote></div><br></div>

--001a114a847c63a79805267b52a4--


--===============4112308624336396442==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------

--===============4112308624336396442==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Doxygen-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/doxygen-develop

--===============4112308624336396442==--