Skip to content

Commit

Permalink
[refs #289] Removed the management of blacklist for migrations. When …
Browse files Browse the repository at this point in the history
…the plugin is loaded, migrations are added to the blacklist. The migrations checker then removes them from the blacklist, and since it edits linter.config, it is not only done for the migrations checker but globally. Therefore the plugin should simply not manage the blacklist for migrations (also avoiding overriding any user-specified behaviour in their .pylintrc)
  • Loading branch information
carlio committed Aug 28, 2020
1 parent 7721691 commit 316c49e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
10 changes: 0 additions & 10 deletions pylint_django/checkers/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,20 +156,10 @@ def func(apps, schema_editor):
return is_migrations_module(node.parent)


def load_configuration(linter): # TODO this is redundant and can be removed
# don't blacklist migrations for this checker
new_black_list = list(linter.config.black_list)
if 'migrations' in new_black_list:
new_black_list.remove('migrations')
linter.config.black_list = new_black_list


def register(linter):
"""Required method to auto register this checker."""
linter.register_checker(NewDbFieldWithDefaultChecker(linter))
linter.register_checker(MissingBackwardsMigrationChecker(linter))
if not compat.LOAD_CONFIGURATION_SUPPORTED:
load_configuration(linter)

# apply augmentations for migration checkers
# Unused arguments for migrations
Expand Down
3 changes: 0 additions & 3 deletions pylint_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ def load_configuration(linter):
name_checker.config.good_names += ('qs', 'urlpatterns', 'register', 'app_name',
'handler400', 'handler403', 'handler404', 'handler500')

# we don't care about South migrations
linter.config.black_list += ('migrations', 'south_migrations')


def register(linter):
"""
Expand Down

0 comments on commit 316c49e

Please sign in to comment.