Skip to content

Commit 81e8294

Browse files
vinaypaiatodorov
authored andcommitted
Add common names to good_names instead of modifying const_rgx
for compatiblity with pylint 1.8+ Fixes pylint-dev#108 Original PR: pylint-dev#109 Obsolete PR: pylint-dev#111
1 parent 527221c commit 81e8294

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pylint_django/plugin.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ def register(linter):
1616
However, we will also use it to amend existing checker config.
1717
"""
1818
name_checker = get_checker(linter, NameChecker)
19-
name_checker.config.good_names += ('qs',)
20-
21-
# Default pylint.checkers.base.CONST_NAME_RGX = re.compile('(([A-Z_][A-Z0-9_]*)|(__.*__))$').
22-
start = name_checker.config.const_rgx.pattern[:-2]
23-
end = name_checker.config.const_rgx.pattern[-2:]
24-
const_rgx = '%s|(urls|urlpatterns|register)%s' % (start, end)
25-
name_checker.config.const_rgx = re.compile(const_rgx)
19+
name_checker.config.good_names += ('qs', 'urlpatterns', 'register', 'app_name')
2620

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

0 commit comments

Comments
 (0)