diff --git a/eprgrader.py b/eprgrader.py index bc694c4..c86d828 100644 --- a/eprgrader.py +++ b/eprgrader.py @@ -215,6 +215,8 @@ def remove_unnecessary_violations(style_check: str): if line_length <= 99: skip_count = 2 continue + else: + line = line.replace('79', '99') # Upper case violations elif "C0103" in line and "doesn't conform to UPPER_CASE naming style" in line: continue @@ -226,6 +228,9 @@ def remove_unnecessary_violations(style_check: str): argument_name = line[start_index:end_index] if len(argument_name) == 1: continue + # Allowing all module names + elif "C0103" in line and "Module name" in line: + continue filtered_lines.append(line) return "\n".join(filtered_lines) diff --git a/violation_checker.py b/violation_checker.py index 3dcee7f..9a1b74f 100644 --- a/violation_checker.py +++ b/violation_checker.py @@ -102,12 +102,13 @@ class ViolationChecker: violation_string += f'-----{violation_group}-----\n{violation_groups_strings[i]}' violation_amount = self.count_violations(i) total_violations = f'\nFehler Insgesamt: {violation_amount}' - possible_deduction = f'Möglicher Abzug: {self.count_deduction(i, 100)}' + possible_deduction = (f'Möglicher Abzug: {self.count_deduction(i, 100)} ' + f'Punkte') deduction = f'Abzug: {self.count_deduction(i, violation_amount)} Punkte\n\n' violation_string += f'{total_violations} {possible_deduction} {deduction}' if i == 9: total_violations = f'\nFehler Insgesamt: {violation_amount}' - possible_deduction = f'Möglicher Abzug: 0' + possible_deduction = f'Möglicher Abzug: 0 Punkte' deduction = 'Abzug: 0 Punkte' violation_string += f'{total_violations} {possible_deduction} {deduction}' return violation_string