make loplugin constantparam smarter about string params
Change-Id: Id3df69b38fd35f46735246a6d307a89aa10d4294 Reviewed-on: https://gerrit.libreoffice.org/37426 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -38,7 +38,7 @@ def RepresentsInt(s):
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
consRegex = re.compile("^\w+\(\)$")
|
||||
constructor_regex = re.compile("^\w+\(\)$")
|
||||
|
||||
tmp1list = list()
|
||||
tmp2list = list()
|
||||
@@ -72,7 +72,7 @@ for callInfo, callValues in callDict.iteritems():
|
||||
else:
|
||||
tmp2list.append((sourceLoc, functionSig, callInfo[3] + " " + callInfo[2], callValue))
|
||||
# look for places where the callsite is always a constructor invocation
|
||||
elif consRegex.match(callValue):
|
||||
elif constructor_regex.match(callValue) or callValue == "\"\"":
|
||||
if callValue.startswith("Get"): continue
|
||||
if callValue.startswith("get"): continue
|
||||
if "operator=" in functionSig: continue
|
||||
|
Reference in New Issue
Block a user