Skip to content

Too broad suppression of unused-argument warnings #249

Closed
@psrb

Description

@psrb

pylint-django currently suppresses the unused-argument warning when a function/method contains an argument called request. The reason to ignore these warnings for an argument named request was discussed in #155 and implemented with commit e4c8fc7.

Unfortunately the warning is also suppressed for all other function arguments. Therefore every other unused argument of the function will not be reported. Unused arguments can be an indicator for bugs and these warnings should only be explicitly silenced.

Example

def user_detail(request, user_id):
    # nothing is done with user_id
    return JsonResponse({'username': 'steve'})

Pylint should issue a warning that user_id is unused. But because the function has an argument named request no warning is issued.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions