Skip to content

Commit

Permalink
add gitflow
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinaProsche committed Nov 17, 2023
2 parents 3c0ee06 + 342728e commit 3ae0696
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/label_merge_conflicts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Check for merge conflicts'

on: [push]

jobs:
find_conflicts:
runs-on: ubuntu-20.04

steps:
- uses: mschilde/auto-label-merge-conflicts@master
with:
CONFLICT_LABEL_NAME: "has conflicts"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAX_RETRIES: 5
WAIT_MS: 5000
9 changes: 7 additions & 2 deletions app/main/checks/report_checks/literature_references.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ class ReferencesToLiteratureCheck(BaseReportCriterion):
description = "Проверка наличия ссылок на все источники"
id = 'literature_references'

def __init__(self, file_info):
def __init__(self, file_info, min_ref=1, max_ref=1000):
super().__init__(file_info)
self.headers = []
self.literature_header = []
self.name_pattern = r'список[ \t]*(использованных|использованной|)[ \t]*(источников|литературы)'
self.md_name_pattern = r"<h2>(Список использованных источников|Список использованной литературы)<\/h2>"
self.min_ref = min_ref
self.max_ref = max_ref

def late_init_vkr(self):
self.headers = self.file.make_chapters(self.file_type['report_type'])
Expand Down Expand Up @@ -48,7 +50,10 @@ def check(self):
for i in range(1, number_of_sources + 1):
all_numbers.add(i)
if len(references.symmetric_difference(all_numbers)) == 0:
return answer(True, f"Пройдена!")
if not self.min_ref <= number_of_sources <= self.max_ref:
return answer(False, f'Список источников оформлен верно, однако их количество ({number_of_sources}) не удовлетворяет необходимому критерию. <br> Количество источников должно быть от {self.min_ref} до {self.max_ref}.')
else:
return answer(True, f"Пройдена!")
elif len(references.difference(all_numbers)):
if len(all_numbers.difference(references)) == 0:
references -= all_numbers
Expand Down

0 comments on commit 3ae0696

Please sign in to comment.