Skip to content
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

Fix pylint_django_settings plugin #35497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mfarhan943
Copy link

@mfarhan943 mfarhan943 commented Sep 18, 2024

Description

This PR resolves the issue with the pylint_django_settings plugin by utilizing the load_configuration(linter) method to dynamically update the DJANGO_SETTINGS_MODULE based on the command-line argument.

Supporting information

#31198

@mfarhan943 mfarhan943 force-pushed the farhan/fix-pylint-django-settings-plugin branch 4 times, most recently from 99b7e7f to 8c4d530 Compare September 19, 2024 06:08
@mfarhan943 mfarhan943 self-assigned this Sep 24, 2024
@mfarhan943 mfarhan943 force-pushed the farhan/fix-pylint-django-settings-plugin branch from 8c4d530 to 6974e9e Compare October 9, 2024 11:02


def register(linter):
linter.register_checker(SetDjangoSettingsChecker(linter))
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this placeholder function still needed?

Copy link
Author

@mfarhan943 mfarhan943 Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the register function is still needed. Pylint requires it to recognize and integrate the pylint_django_settings plugin properly. Without it, Pylint raises an AttributeError. Defining the register function resolves this issue.

@mfarhan943 mfarhan943 force-pushed the farhan/fix-pylint-django-settings-plugin branch from 52e4f02 to 6974e9e Compare October 9, 2024 17:50
@mfarhan943 mfarhan943 force-pushed the farhan/fix-pylint-django-settings-plugin branch from 6974e9e to 820d640 Compare October 9, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants