mirror of
https://github.com/JonasunderscoreJones/epr_grader.git
synced 2025-10-25 01:09:19 +02:00
Ignoring module name violations
This commit is contained in:
parent
f8422f33fb
commit
f5b7931dc9
2 changed files with 8 additions and 2 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue