edx-platform
edx-platform copied to clipboard
Fix pylint-django-settings plugin
Description
- PR https://github.com/openedx/edx-platform/pull/31084 removes the usage of the
pylint-django-settings
plugin temporarily due to the breaking changes in the script with the latest pylint version (pylint~=2.1.5.0
). - Once the above mentioned PR is merged, fix the script and update the pylint quality shards to start using the plugin again.
A suggestion that maybe of help in this issue:
Re your issues with the Django settings path, I had what may be a similar issue in https://github.com/openedx/blockstore/pull/208 and I fixed it with this: https://github.com/openedx/blockstore/blob/c2a782b5ce7e6b3e866f537521282a545e6d597e/pylintrc_tweaks#L3-L5 Not sure if that'll be useful here but just letting you know in case it is.
Findings:
- pylint-django-settings plugin was working fine with
pylint==2.13.9
but as we switch topylint==2.14.0
it starts giving django not configured warning. - During the debugging, there is
django_settings_module
is available in config but empty, even when we are setting it in plugin, it is still giving django not configured warning. - It seems that the settings is already setting somewhere else before it reach to plugin and the setting we are updating in plugin are not effecting.
- On reading
pylint==2.14.0
release note, I found that the global settings are setting by checker.linter.config.django_settings_module, I also tried this, but still facing the same warning.
Verify above comment, and if it is not possible to fix the plugin then remove plugin code from edx-platform and close this ticket.