[checker] make pycoverage reportings percentage instead of ratios (<1.0)
authorDavid Douard <david.douard@logilab.fr>
Tue, 05 Jan 2016 14:42:24 +0100
changeset 1854 f1cb7556f384
parent 1853 746d21ef4c02
child 1855 9af15350aaef
[checker] make pycoverage reportings percentage instead of ratios (<1.0) also report thresholds used for error/warning classification
_narval/checkers/apycot/python.py
--- a/_narval/checkers/apycot/python.py	Tue Dec 22 11:05:27 2015 +0100
+++ b/_narval/checkers/apycot/python.py	Tue Jan 05 14:42:24 2016 +0100
@@ -621,8 +621,10 @@
         if line_rate is None:
             return ERROR
         # global summary
-        self.writer.raw('cover-line-rate', '%.3f' % line_rate, 'result')
-        self.writer.raw('cover-branch-rate', '%.3f' % branch_rate, 'result')
+        self.writer.raw('error-threshold', '%.1f' % (100.0*self.threshold), 'config')
+        self.writer.raw('warning-threshold', '%.1f' % (100.0*self.threshold/2), 'config')
+        self.writer.raw('cover-line-rate', '%.1f' % (100.0*line_rate), 'result')
+        self.writer.raw('cover-branch-rate', '%.1f' % (100.0*branch_rate), 'result')
         if line_rate < self.threshold:
             return FAILURE
         return SUCCESS