-
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
unused argument schema_editor in django data migrations #267
Comments
So if you have a function like that:
There are several possibilities here:
Pylint does not warn about arguments starting with an underscore. You can still see that it is a Secondly you could explicitly ignore the warning on the line:
In this way you can fix your specific problem without needing pylint-django to have a new release. |
@carlio : thanks for looking into this.... i know about the second option to disable a specific line, but adding that to every migration would be painful, but the first option makes sense. I didn't know about that... hence closing the issue |
@lokesh1729 no worries, check out this section of the documentation: http://pylint.pycqa.org/en/latest/technical_reference/features.html#variables-checker-options By default |
Reopening b/c pyint_django should be smart enough to ignore these unused arguments in a similar way we do for view methods. |
Fixed via #273 |
in django when writing data migrations, the function definition would like this
here,
apps
andschema_editor
will be passed by django when applying migration. There are cases where either of them will not be used. In such casespylint-django
should not complainunused-argument
error.EXPECTED : it is expected that to have a exception for this case
It happened many times that folks in our team removes
schema_editor
whenpylint
complains withunused-argument
and that result into errors.here's pip freeze
The text was updated successfully, but these errors were encountered: