[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#912912: lintian: please detect for loops without set -e



tags 912912 + moreinfo
thanks

Hi Mattia,

> See #912910 - I think these situations could easily be detected by
> lintian, and marked with an E-tag when d/rules doesn't.

First, great idea for a check

Not wishing to play severity wars but I think E-tag would be a
little aggressive for such a tag, but I  worry we would expect a
large number of false-positives. For example:

     for var in $(things_to_to_loop_on); do \
         $(whatever) || exit $?; \
     done

I mean, this exact code exists in disorderfs (albeit in tests/
Makefile, not debian/rules).

> Note however that the set -e could be omitted if one has
 
Detecting SHELL=sh -e and .SHELLFLAGS=-ec reliably too would only
complicate such things.

Could you perhaps run some codesearch.debian.net queries to see
what kind of false-positives we could expect? There will definitely
be some, but if it's above "some" threshold I think this might be
beyond Lintian's reach, alas.


Best wishes,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-


Reply to: