-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning for view functions #155
Comments
Right now you can disable with It should be possible to teach pylint_django to ignore this error but I'll have to see how to do that. May not be very easy though. |
Thanks @atodorov for replying. Change the argument to |
in fact we disable this error just based on the argument name. For functions it is not really possible to reliably determine if the function is a real view that serves http requests or a plain-old-function (maybe a helper) where the argument was named 'request'.
in fact we disable this error just based on the argument name. For functions it is not really possible to reliably determine if the function is a real view that serves http requests or a plain-old-function (maybe a helper) where the argument was named 'request'.
…v#249) The previous implementation (result of pylint-dev#155) of disabling the unused-argument warning for functions/methods having an argument named `request` was to broad. As soon as a function/method contains a `request` argument no unused-argument warning will be issued for this function anymore, even though some other arguments are unused! This commit extends the `ignored-argument-names` regex of Pylint to also ignore arguments named `request`. This way unused-argument warnings will still be issued for every other unused argument of the function/method.
…v#249) The previous implementation (result of pylint-dev#155) of disabling the unused-argument warning for functions/methods having an argument named `request` was to broad. As soon as a function/method contains a `request` argument no unused-argument warning will be issued for this function anymore, even though some other arguments are unused! This commit extends the `ignored-argument-names` regex of Pylint to also ignore arguments named `request`. This way unused-argument warnings will still be issued for every other unused argument of the function/method.
…v#249) The previous implementation (result of pylint-dev#155) of disabling the unused-argument warning for functions/methods having an argument named `request` was to broad. As soon as a function/method contains a `request` argument no unused-argument warning will be issued for this function anymore, even though some other arguments are unused! This commit extends the `ignored-argument-names` regex of Pylint to also ignore arguments named `request`. This way unused-argument warnings will still be issued for every other unused argument of the function/method.
The previous implementation (result of #155) of disabling the unused-argument warning for functions/methods having an argument named `request` was to broad. As soon as a function/method contains a `request` argument no unused-argument warning will be issued for this function anymore, even though some other arguments are unused! This commit extends the `ignored-argument-names` regex of Pylint to also ignore arguments named `request`. This way unused-argument warnings will still be issued for every other unused argument of the function/method.
…v#249) The previous implementation (result of pylint-dev#155) of disabling the unused-argument warning for functions/methods having an argument named `request` was to broad. As soon as a function/method contains a `request` argument no unused-argument warning will be issued for this function anymore, even though some other arguments are unused! This commit monkey patches `VariablesChecker._is_ignored_named` to specifically suppress the generation of unused-argument warnings for arguments named `request`. This way unused-argument warnings will still be issued for every other unused argument of the function/method.
The previous implementation (result of #155) of disabling the unused-argument warning for functions/methods having an argument named `request` was to broad. As soon as a function/method contains a `request` argument no unused-argument warning will be issued for this function anymore, even though some other arguments are unused! This commit monkey patches `VariablesChecker._is_ignored_named` to specifically suppress the generation of unused-argument warnings for arguments named `request`. This way unused-argument warnings will still be issued for every other unused argument of the function/method.
Django's view functions have signature of
request
. Even I don't usereqest
, I would like to include it as part of signature. But if I run:pylint --load-plugins pylint_django views.py W:184,12: Unused argument 'request' (unused-argument)
My question is: is there a way to surpass this warning?
The text was updated successfully, but these errors were encountered: