aboutsummaryrefslogtreecommitdiff
path: root/scripts/maint/practracker/problem.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/maint/practracker/problem.py')
-rw-r--r--scripts/maint/practracker/problem.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/maint/practracker/problem.py b/scripts/maint/practracker/problem.py
index 73519d446f..13c8e55143 100644
--- a/scripts/maint/practracker/problem.py
+++ b/scripts/maint/practracker/problem.py
@@ -108,10 +108,11 @@ class ProblemFilter(object):
self.thresholds = dict()
def addThreshold(self, item):
- self.thresholds[item.get_type()] = item
+ self.thresholds[(item.get_type(),item.get_file_type())] = item
def matches(self, item):
- filt = self.thresholds.get(item.get_type(), None)
+ key = (item.get_type(), item.get_file_type())
+ filt = self.thresholds.get(key, None)
if filt is None:
return False
return item.is_worse_than(filt)
@@ -158,6 +159,12 @@ class Item(object):
def get_type(self):
return self.problem_type
+ def get_file_type(self):
+ if self.problem_location.endswith(".h"):
+ return "*.h"
+ else:
+ return "*.c"
+
class FileSizeItem(Item):
"""
Denotes a problem with the size of a .c file.