Allow per project misra.py addon (#1241)

Use python's __file__ variable to figure out where the checker script is
located.

This allows a customized per project scripts to be used instead of the
one provided in the cppcheck release.
This commit is contained in:
Richard A. Smith 2018-05-20 08:42:25 -04:00 committed by Daniel Marjamäki
parent a26d73f78f
commit 672d0433a4
1 changed files with 1 additions and 1 deletions

View File

@ -1455,7 +1455,7 @@ def generateTable():
# what rules are handled by this addon?
addon = []
compiled = re.compile(r'[ ]+misra_([0-9]+)_([0-9]+)[(].*')
for line in open('misra.py'):
for line in open('__file__'):
res = compiled.match(line)
if res is None:
continue