Skip to content

Commit 49158e7

Browse files
committed
build: Move the pylint_django_settings plugin.
When it was located at the root of the project, it was sometimes not getting loaded correctly since the root of the project is not a python module, and producing the following error: ``` Command line or configuration file:1:0: E0013: Plugin 'pylint_django_settings' is impossible to load, is it installed ? ('No module named 'pylint_django_settings'') (bad-plugin-value) ``` This led all the pylint tests to fail. This started happening more as we updated other dependencies via make upgrade for some reason and led to inconsistent builds. The move should hopefully make the loading reliable and consistent.
1 parent 86ded1c commit 49158e7

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# SERIOUSLY.
6565
#
6666
# ------------------------------
67-
# Generated by edx-lint version: 5.3.0
67+
# Generated by edx-lint version: 5.6.0
6868
# ------------------------------
6969
[*]
7070
end_of_line = lf
@@ -97,4 +97,4 @@ max_line_length = 72
9797
[*.rst]
9898
max_line_length = 79
9999

100-
# eecef7d3f7f334de2348fe1b4b0b48d605f7dcab
100+
# 3eb1e01bd9ba6cdf1e5d0a493581c4ea14404b67

pylint_django_settings.py renamed to openedx/core/tests/pylint_django_settings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""
2+
This is a plugin that helps pylint figure out what DJANGO_SETTINGS_MODULE to use for linting different files. Since the
3+
LMS and CMS files have different expectations about what django settings including which installed apps and settings are
4+
set when the code is run.
5+
"""
16
import os
27
import sys
38

@@ -40,7 +45,7 @@ def register(linter):
4045
"""
4146
Placeholder function to register the plugin with pylint.
4247
"""
43-
pass
48+
return
4449

4550

4651
def load_configuration(linter):

pylintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@
6464
# SERIOUSLY.
6565
#
6666
# ------------------------------
67-
# Generated by edx-lint version: 5.4.1
67+
# Generated by edx-lint version: 5.6.0
6868
# ------------------------------
6969
[MASTER]
7070
ignore = ,.git,.tox,migrations,node_modules,.pycharm_helpers
7171
persistent = yes
72-
load-plugins = edx_lint.pylint,pylint_django_settings,pylint_django,pylint_celery,pylint_pytest
72+
load-plugins = edx_lint.pylint,openedx.core.tests.pylint_django_settings,pylint_django,pylint_celery,pylint_pytest
7373

7474
[MESSAGES CONTROL]
7575
enable =
@@ -414,4 +414,4 @@ int-import-graph =
414414
[EXCEPTIONS]
415415
overgeneral-exceptions = builtins.Exception
416416

417-
# 5aea7d7fb264005eb373099c856a54cdfa4f311c
417+
# d6e4348dec0a8eb2752fc4fe02315286c298aeff

pylintrc_tweaks

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pylintrc tweaks for use with edx_lint.
22
[MASTER]
33
ignore+ = ,.git,.tox,migrations,node_modules,.pycharm_helpers
4-
load-plugins = edx_lint.pylint,pylint_django_settings,pylint_django,pylint_celery,pylint_pytest
4+
load-plugins = edx_lint.pylint,openedx.core.tests.pylint_django_settings,pylint_django,pylint_celery,pylint_pytest
55

66
[MESSAGES CONTROL]
77
disable+ =

0 commit comments

Comments
 (0)