From 672d0433a4193792c24c151f844b510c4d3337f5 Mon Sep 17 00:00:00 2001 From: "Richard A. Smith" Date: Sun, 20 May 2018 08:42:25 -0400 Subject: [PATCH] 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. --- addons/misra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/misra.py b/addons/misra.py index b68410929..27314b4eb 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -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