Skip to content

Commit 1f5a8fa

Browse files
Update banned_words_in_literature.py
1 parent c402416 commit 1f5a8fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/main/checks/report_checks/banned_words_in_literature.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ class BannedWordsInLiteratureCheck(BaseReportCriterion):
88
description = 'Запрещено упоминание слова "wikipedia"'
99
id = 'banned_words_in_literature'
1010

11-
def __init__(self, file_info, banned_words=["wikipedia"]):
11+
def __init__(self, file_info, banned_words=None):
1212
super().__init__(file_info)
13+
self.banned_words = ["habr", "medium", "stackoverflow", "sky.pro", "geeksforgeeks", "wikipedia"]
14+
if banned_words:
15+
self.banned_words += banned_words
16+
self.banned_words = [morph.normal_forms(word)[0] for word in self.banned_words]
1317
self.headers_page = 1
1418
self.literature_header = []
15-
self.banned_words = [morph.normal_forms(word)[0] for word in banned_words]
1619
self.name_pattern = r'список[ \t]*(использованных|использованной|)[ \t]*(источников|литературы)'
1720

1821
def late_init_vkr(self):

0 commit comments

Comments
 (0)