Skip to content

Commit 5de49fc

Browse files
update paragraphs_count_check
1 parent fe1c3dd commit 5de49fc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/main/checks/report_checks/paragraphs_count_check.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class ReportParagraphsCountCheck(BaseReportCriterion):
77
description = ""
88
id = "paragraphs_count_check"
99

10-
def __init__(self, file_info, min_paragraphs_in_unnumbered_section=5, min_paragraphs_in_section=10,
11-
min_paragraphs_in_subsection=5, min_paragraphs_in_subsubsection=1):
10+
def __init__(self, file_info, min_paragraphs_in_unnumbered_section=2, min_paragraphs_in_section=5,
11+
min_paragraphs_in_subsection=5, min_paragraphs_in_subsubsection=1, skip_sections=None):
1212
super().__init__(file_info)
1313
self.min_count_paragraphs = {
1414
"unnumbered_section": min_paragraphs_in_unnumbered_section,
@@ -19,6 +19,7 @@ def __init__(self, file_info, min_paragraphs_in_unnumbered_section=5, min_paragr
1919
self.heading_styles = {style: value["docx_style"] for style, value in StyleCheckSettings.VKR_CONFIG.items()}
2020
self.paragraphs_count = []
2121
self.headers = []
22+
self.skip_sections = skip_sections if skip_sections else list()
2223

2324
def late_init(self):
2425
self.headers = self.file.make_chapters(self.file_type['report_type'])
@@ -47,6 +48,11 @@ def check(self):
4748
def find_paragraphs_count(self):
4849
i = 0
4950
while i < len(self.headers):
51+
for skip_section in self.skip_sections:
52+
if skip_section.lower() in self.headers[i]["text"].lower():
53+
i+=1
54+
continue
55+
5056
if "ПРИЛОЖЕНИЕ" in self.headers[i]["text"]:
5157
break
5258

0 commit comments

Comments
 (0)