Opened 9 months ago

Closed 7 months ago

#28008 closed defect (fixed)

shellcheck: coverage script issues

Reported by: rl1987 Owned by:
Priority: Medium Milestone: Tor: 0.4.0.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: technical-debt
Cc: Actual Points:
Parent ID: Points:
Reviewer: asn Sponsor:

Description

Shellcheck (​​https://github.com/koalaman/shellcheck) finds the following issues:

In coverage line 11:
    BN=`basename $fn`
       ^-- SC2006: Use $(..) instead of legacy `..`.
                 ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 12:
    DN=`dirname $fn`
       ^-- SC2006: Use $(..) instead of legacy `..`.
                ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 13:
    F=`echo $BN | sed -e 's/\.c$//;'`
      ^-- SC2006: Use $(..) instead of legacy `..`.
            ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 16:
    ONS=`echo ${DN}/src_*-${F}.o`
        ^-- SC2006: Use $(..) instead of legacy `..`.
              ^-- SC2086: Double quote to prevent globbing and word splitting.
                          ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 23:
        GCNO=`echo $on | sed -e 's/\.o$/\.gcno/;'`
             ^-- SC2006: Use $(..) instead of legacy `..`.
                   ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 24:
        if [ -e $GCNO ]
                ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 28:
          rm -f $GC
                ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 29:
          gcov -o $on $fn
                  ^-- SC2086: Double quote to prevent globbing and word splitting.
                      ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 30:
          if [ -e $GC ]
                  ^-- SC2086: Double quote to prevent globbing and word splitting.


In coverage line 34:
              mv $GC $dst/$GC
                 ^-- SC2086: Double quote to prevent globbing and word splitting.
                     ^-- SC2086: Double quote to prevent globbing and word splitting.
                          ^-- SC2086: Double quote to prevent globbing and word splitting.

Child Tickets

Change History (6)

comment:1 Changed 8 months ago by teor

Keywords: technical-debt added
Milestone: Tor: 0.3.6.x-final

Since these tickets are about technical debt, I'm tentatively putting them in 0.3.6.

To avoid issues like this in future, we could run shellcheck as part of "make check" (#28058).

comment:2 Changed 8 months ago by nickm

Milestone: Tor: 0.3.6.x-finalTor: 0.4.0.x-final

Tor 0.3.6.x has been renamed to 0.4.0.x.

comment:3 Changed 8 months ago by rl1987

Status: newneeds_review

comment:4 Changed 8 months ago by asn

Reviewer: asn

comment:5 Changed 7 months ago by asn

Status: needs_reviewmerge_ready

LGTM!

Please find PR with branch rebased to latest master (where appveyor passes) here:
https://github.com/torproject/tor/pull/518

comment:6 Changed 7 months ago by nickm

Resolution: fixed
Status: merge_readyclosed

ok, merged to master!

Note: See TracTickets for help on using tickets.