Skip to content

Conversation

Vladen35
Copy link
Collaborator

No description provided.

@Vladen35 Vladen35 linked an issue Sep 21, 2025 that may be closed by this pull request
for repo in list_repos:
pattern = r'[0-9A-Za-z-_\.]+/[0-9A-Za-z-_\.]+'
if not re.fullmatch(pattern, repo):
print('Names must be in the format <organization or owner>/<name>')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Names must be in the format / поменять на Repository name must be in the format /
  2. Использовать logging.error вместо принта. Пример тут Так код выглядит более профессионально, плюс там добавляется время ошибки, что иногда может быть полезно

Comment on lines 39 to 41
for repo in list_repos:
pattern = r'[0-9A-Za-z-_\.]+/[0-9A-Za-z-_\.]+'
if not re.fullmatch(pattern, repo):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут каждый раз в цикле собирается дерево регулярно по новой
Лучше собрать (скомпилировать) регулярное выражение 1 раз и переиспользовать

pattern = re.compile(r'[0-9A-Za-z-_\.]+/[0-9A-Za-z-_\.]+')
for repo in list_repos:
    if not pattern.fullmatch(repo):

Copy link
Collaborator

@thehighestmath thehighestmath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Все гучи

@thehighestmath thehighestmath merged commit 8d04875 into master Sep 22, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Валидация файла со списком репо
2 participants