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:
Noel Grandin
2017-05-09 12:14:32 +02:00
parent 3a9854a929
commit 12191a4f30
56 changed files with 117 additions and 146 deletions

View File

@@ -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