Ignoring module name violations

This commit is contained in:
Lukas Horst 2024-10-24 20:59:45 +02:00
parent f8422f33fb
commit f5b7931dc9
2 changed files with 8 additions and 2 deletions

View file

@ -215,6 +215,8 @@ def remove_unnecessary_violations(style_check: str):
if line_length <= 99: if line_length <= 99:
skip_count = 2 skip_count = 2
continue continue
else:
line = line.replace('79', '99')
# Upper case violations # Upper case violations
elif "C0103" in line and "doesn't conform to UPPER_CASE naming style" in line: elif "C0103" in line and "doesn't conform to UPPER_CASE naming style" in line:
continue continue
@ -226,6 +228,9 @@ def remove_unnecessary_violations(style_check: str):
argument_name = line[start_index:end_index] argument_name = line[start_index:end_index]
if len(argument_name) == 1: if len(argument_name) == 1:
continue continue
# Allowing all module names
elif "C0103" in line and "Module name" in line:
continue
filtered_lines.append(line) filtered_lines.append(line)
return "\n".join(filtered_lines) return "\n".join(filtered_lines)

View file

@ -102,12 +102,13 @@ class ViolationChecker:
violation_string += f'-----{violation_group}-----\n{violation_groups_strings[i]}' violation_string += f'-----{violation_group}-----\n{violation_groups_strings[i]}'
violation_amount = self.count_violations(i) violation_amount = self.count_violations(i)
total_violations = f'\nFehler Insgesamt: {violation_amount}' 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' deduction = f'Abzug: {self.count_deduction(i, violation_amount)} Punkte\n\n'
violation_string += f'{total_violations} {possible_deduction} {deduction}' violation_string += f'{total_violations} {possible_deduction} {deduction}'
if i == 9: if i == 9:
total_violations = f'\nFehler Insgesamt: {violation_amount}' 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' deduction = 'Abzug: 0 Punkte'
violation_string += f'{total_violations} {possible_deduction} {deduction}' violation_string += f'{total_violations} {possible_deduction} {deduction}'
return violation_string return violation_string