From dbc1f83d3aa4318c688137234f7030fa3294ecf5 Mon Sep 17 00:00:00 2001 From: derAnfaenger Date: Wed, 8 Nov 2017 19:34:49 +0100 Subject: [PATCH] linter: Make string formatting custom rule more complete. --- tools/linter_lib/custom_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index cbc345b671..479f00cae9 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -296,12 +296,12 @@ def build_custom_checkers(by_lang): # This next check could have false positives, but it seems pretty # rare; if we find any, they can be added to the exclude list for # this rule. - {'pattern': ' % [a-zA-Z0-9_.]*\)?$', + {'pattern': ' % [a-zA-Z0-9_."\']*\)?$', 'exclude_line': set([ ('tools/tests/test_template_parser.py', '{% foo'), ]), 'description': 'Used % comprehension without a tuple'}, - {'pattern': '.*%s.* % \([a-zA-Z0-9_.]*\)$', + {'pattern': '.*%s.* % \([a-zA-Z0-9_."\']*\)$', 'description': 'Used % comprehension without a tuple'}, {'pattern': 'django.utils.translation', 'include_only': set(['test/']),