Skip to content

Commit

Permalink
Add common names to good_names instead of modifying const_rgx
Browse files Browse the repository at this point in the history
for compatiblity with pylint 1.8+

Fixes pylint-dev#108
Original PR: pylint-dev#109
Obsolete PR: pylint-dev#111
  • Loading branch information
vinaypai authored and atodorov committed Jan 18, 2018
1 parent 527221c commit 81e8294
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pylint_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ def register(linter):
However, we will also use it to amend existing checker config.
"""
name_checker = get_checker(linter, NameChecker)
name_checker.config.good_names += ('qs',)

# Default pylint.checkers.base.CONST_NAME_RGX = re.compile('(([A-Z_][A-Z0-9_]*)|(__.*__))$').
start = name_checker.config.const_rgx.pattern[:-2]
end = name_checker.config.const_rgx.pattern[-2:]
const_rgx = '%s|(urls|urlpatterns|register)%s' % (start, end)
name_checker.config.const_rgx = re.compile(const_rgx)
name_checker.config.good_names += ('qs', 'urlpatterns', 'register', 'app_name')

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

0 comments on commit 81e8294

Please sign in to comment.