[Django] #30283: Lint errors in django_bash_completion script

7 views
Skip to first unread message

Django

unread,
Mar 23, 2019, 5:08:45 AM3/23/19
to django-...@googlegroups.com
#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.

Django

unread,
Mar 23, 2019, 5:11:26 AM3/23/19
to django-...@googlegroups.com
#30283: Lint errors in django_bash_completion script
-------------------------------------+-------------------------------------
Reporter: albertyw | Owner: albertyw
Type: | Status: assigned
Cleanup/optimization |
Component: Utilities | Version: 2.1
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by albertyw):

PR at https://code.djangoproject.com/ticket/30283

--
Ticket URL: <https://code.djangoproject.com/ticket/30283#comment:1>

Django

unread,
Mar 23, 2019, 11:57:13 AM3/23/19
to django-...@googlegroups.com
#30283: Lint errors in django_bash_completion script
-------------------------------------+-------------------------------------
Reporter: albertyw | Owner: albertyw
Type: | Status: closed
Cleanup/optimization |
Component: Utilities | Version: 2.1
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"2ee1e1a1744c4d0679058124eb7ceba78a0a5a84" 2ee1e1a]:
{{{
#!CommitTicketReference repository=""
revision="2ee1e1a1744c4d0679058124eb7ceba78a0a5a84"
Fixed #30283 -- Fixed shellcheck warnings in django_bash_completion.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30283#comment:2>

Reply all
Reply to author
Forward
0 new messages