#30283: Lint errors in django_bash_completion script
------------------------------------------------+--------------------------
               Reporter:  albertyw              |          Owner:  albertyw
                   Type:  Cleanup/optimization  |         Status:  assigned
              Component:  Utilities             |        Version:  2.1
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  1
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+--------------------------
 The django_bash_completion script has a few bash lint warnings from
 shellcheck.  None of the errors are likely to affect users, except for
 using `grep -E` instead of `egrep` which should increase compatibility
 with different systems.

 {{{

 In extras/django_bash_completion line 1:
 #
 #########################################################################
 ^-- SC2148: Tips depend on target shell and yours is unknown. Add a
 shebang.


 In extras/django_bash_completion line 46:
         echo $PYTHON_EXE | egrep "python([3-9]\.[0-9])?" >/dev/null 2>&1
              ^-- SC2086: Double quote to prevent globbing and word
 splitting.
                            ^-- SC2196: egrep is non-standard and
 deprecated. Use grep -E instead.


 In extras/django_bash_completion line 47:
         if [[ $? == 0 ]]; then
               ^-- SC2181: Check exit code directly with e.g. 'if mycmd;',
 not indirectly with $?.


 In extras/django_bash_completion line 49:
             echo $PYTHON_SCRIPT | egrep "manage\.py|django-admin(\.py)?"
 >/dev/null 2>&1
                  ^-- SC2086: Double quote to prevent globbing and word
 splitting.
                                   ^-- SC2196: egrep is non-standard and
 deprecated. Use grep -E instead.


 In extras/django_bash_completion line 50:
             if [[ $? == 0 ]]; then
                   ^-- SC2181: Check exit code directly with e.g. 'if
 mycmd;', not indirectly with $?.


 In extras/django_bash_completion line 51:
                 COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]:1}" \
                                ^-- SC2097: This assignment is only seen by
 the forked process.


 In extras/django_bash_completion line 53:
                                DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) )
                                                       ^-- SC2098: This
 expansion will not see the mentioned assignment.


 In extras/django_bash_completion line 67:
     pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
                    ^-- SC2086: Double quote to prevent globbing and word
 splitting.
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30283>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.a5280910f6fba29a42c7a87f3ec8592b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to