[dpdk-dev] [PATCH 1/2] scripts: add checkpatch wrapper

Bruce Richardson bruce.richardson at intel.com
Thu Oct 29 14:48:15 CET 2015


On Thu, Oct 29, 2015 at 02:34:32PM +0100, Thomas Monjalon wrote:
> 2015-10-29 13:24, Bruce Richardson:
> > On Thu, Oct 29, 2015 at 02:03:59PM +0100, Thomas Monjalon wrote:
> > > 2015-10-29 13:33, David Marchand:
> > > > On Fri, Oct 23, 2015 at 5:53 PM, Thomas Monjalon <thomas.monjalon at 6wind.com>
> > > > wrote:
> > > > 
> > > > > +for p in "$@" ; do
> > > > > +       printf -- "\n### $p\n\n"
> > > > > +       report=$($DPDK_CHECKPATCH_PATH $options "$p" 2>/dev/null)
> > > > > +       [ $? -ne 0 ] || continue
> > > > > +       printf '%s\n' "$report" | head -n -6
> > > > > +       status=$(($status + 1))
> > > > > +done
> > > > > +exit $status
> > > > >
> > > > 
> > > > I prefer when checking scripts only complain when something is wrong :-)
> > > > So I would only display the file name if checkpatch complains.
> > > 
> > > Yes I'll move the first printf after the "continue".
> > 
> > Ok, but perhaps instead we can get a print at the end of how many files were
> > checked. I'm concerned about the case where we think we have checked something and
> > it's ok, when in fact we have actually had an error in our command and e.g. not checked
> > any files at all. The printing of the filename helps give a guarantee that the
> > script is doing the right thing, so if it goes away, I'd hope for some other method
> > to ensure that.
> 
> I agree with both of you.
> I could suggest something but I'm afraid it will be difficult to have a
> consensus between a "quiet tool" and a "double check verbose tool".
> As it is a really critical piece of code, I think we should have a meeting
> with a technical steering comittee ;)
> ... or we can add an option: -q or -v ? Debate is open :D
> 
Yes, the whole future of the project could hinge on this decision :-)

Ok, my suggestion is both! 
1) Have the default (in case of no errors), be a single line print out at the end
stating number of files scanned
2) If "-q" flag specified, skip this
3) If "-v" flag specified, do current behaviour with a line per file.

Regards,

/Bruce


More information about the dev mailing list