Skip to content

Commit

Permalink
fix: update pylint_django_settings linter settings
Browse files Browse the repository at this point in the history
  • Loading branch information
UsamaSadiq committed Jan 27, 2025
1 parent e714eaf commit 28caed2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pylint_django_settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pylint_django.checkers import ForeignKeyStringsChecker
from pylint_plugin_utils import get_checker
import os
import sys


class ArgumentCompatibilityError(Exception):
Expand Down Expand Up @@ -47,6 +47,4 @@ def load_configuration(linter):
"""
Configures the Django settings module based on the command-line arguments passed to pylint.
"""
name_checker = get_checker(linter, ForeignKeyStringsChecker)
arguments = linter.cmdline_parser.parse_args()[1]
name_checker.config.django_settings_module = _get_django_settings_module(arguments)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", _get_django_settings_module(sys.argv[1:]))

0 comments on commit 28caed2

Please sign in to comment.