Improve hacking rule that checks that [] & {} are used
It is bad to use list() or dict() instead of [] or {} because it has more symbols and works slower. Change-Id: I80e1a87c8f18c8dd231be421e065a2f329a3aa91
This commit is contained in:
parent
2b7ce5db70
commit
db1887ddc3
@ -47,9 +47,9 @@ re_assert_equal_in_end_with_true_or_false = re.compile(
|
|||||||
re_assert_equal_in_start_with_true_or_false = re.compile(
|
re_assert_equal_in_start_with_true_or_false = re.compile(
|
||||||
r"assertEqual\((True|False), (\w|[][.'\"])+( not)? in (\w|[][.'\", ])+\)")
|
r"assertEqual\((True|False), (\w|[][.'\"])+( not)? in (\w|[][.'\", ])+\)")
|
||||||
re_no_construct_dict = re.compile(
|
re_no_construct_dict = re.compile(
|
||||||
r"=\sdict\(\)")
|
r"\sdict\(\)")
|
||||||
re_no_construct_list = re.compile(
|
re_no_construct_list = re.compile(
|
||||||
r"=\slist\(\)")
|
r"\slist\(\)")
|
||||||
re_str_format = re.compile(r"""
|
re_str_format = re.compile(r"""
|
||||||
% # start of specifier
|
% # start of specifier
|
||||||
\(([^)]+)\) # mapping key, in group 1
|
\(([^)]+)\) # mapping key, in group 1
|
||||||
@ -57,7 +57,8 @@ re_str_format = re.compile(r"""
|
|||||||
(?:-?\d*)? # optional minimum field width
|
(?:-?\d*)? # optional minimum field width
|
||||||
(?:\.\d*)? # optional precision
|
(?:\.\d*)? # optional precision
|
||||||
[hLl]? # optional length modifier
|
[hLl]? # optional length modifier
|
||||||
[A-z%] # conversion modifier""", re.X)
|
[A-z%] # conversion modifier
|
||||||
|
""", re.X)
|
||||||
|
|
||||||
|
|
||||||
def skip_ignored_lines(func):
|
def skip_ignored_lines(func):
|
||||||
|
Loading…
Reference in New Issue
Block a user