edx-platform icon indicating copy to clipboard operation
edx-platform copied to clipboard

Fix pylint-django-settings plugin

Open UsamaSadiq opened this issue 2 years ago • 3 comments

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.

UsamaSadiq avatar Oct 25 '22 07:10 UsamaSadiq

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.

UsamaSadiq avatar Oct 27 '22 07:10 UsamaSadiq

Findings:

  • pylint-django-settings plugin was working fine with pylint==2.13.9 but as we switch to pylint==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.

zubairshakoorarbisoft avatar Oct 17 '23 13:10 zubairshakoorarbisoft

Verify above comment, and if it is not possible to fix the plugin then remove plugin code from edx-platform and close this ticket.

iamsobanjaved avatar Jul 11 '24 14:07 iamsobanjaved