Changeset 172
- Timestamp:
- 02/04/07 08:34:54 (2 years ago)
- Files:
-
- trunk/cheesecake/cheesecake_index.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cheesecake/cheesecake_index.py
r170 r172 1125 1125 """ 1126 1126 name = "pep8" 1127 max_value = 0 1127 1128 # 1129 # Max value is a number of possible pep8 errors times 2, 1130 # plus number of possible pep8 warnings. 1131 # 1132 # Currently pep8 module support 15 errors: 1133 # E101, 1134 # E111, E112, E113, 1135 # E201, E202, E203, 1136 # E211, 1137 # E221, E222, 1138 # E301, E302, E303, 1139 # E401, 1140 # E501 1141 # and 4 warnings: 1142 # W191, 1143 # W291, 1144 # W601, 1145 # W602 1146 # 1147 max_value = 34 1148 1128 1149 error_score = -2 1129 1150 warning_score = -1 1130 1131 1151 1132 1152 def compute(self, files_list, package_dir): … … 1145 1165 error_stats = pep8.get_error_statistics() 1146 1166 warning_stats = pep8.get_warning_statistics() 1167 1147 1168 errors = len(error_stats) 1148 1169 warnings = len(warning_stats) 1170 1149 1171 total_error_score = self.error_score * errors 1150 1172 total_warning_score = self.warning_score * warnings 1173 1151 1174 score = total_error_score + total_warning_score 1175 self.value = self.max_value + score 1152 1176 1153 1177 self.add_info("Errors:") … … 1163 1187 self.add_info("pep8.py found %d warning types; we're scoring %d per warning type" % (warnings, self.warning_score)) 1164 1188 self.add_info("Warning score: %d" % total_warning_score) 1165 self.add_info("Total pep8 score: %d" % score) 1166 1167 self.value = score 1189 self.add_info("Total pep8 score: %d - %d = %d" % (self.max_value, abs(score), self.value)) 1190 1168 1191 self.details = "pep8.py check: %d error types, %d warning types" % (errors, warnings) 1169 1192 return self.value
