-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added flag -c contributors logging #35
base: master
Are you sure you want to change the base?
Conversation
Попробовал экспорт, в таблице оказываются не все пользователи. Дал вам админские права на репо - посмотрите вот тут на список участников https://github.com/OSLL/github_repo_commitment_calc/settings/access?query= и попробуйте разобратся, почему не все они оказываются у нас в итоговом файле |
@@ -71,8 +72,11 @@ def main(): | |||
git_logger.log_issues(client, repositories, csv_name, token, start, finish) | |||
if (args.e): | |||
export_sheets.write_data_to_table(csv_name, args.google_token, args.table_id, args.sheet_id) | |||
if args.invites: | |||
git_logger.log_invitations(client, repositories, csv_name) | |||
if (args.c): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
скобки не нужны тут
if args.c:
git_logger.log_invitations(client, repositories, csv_name) | ||
if (args.c): | ||
git_logger.log_contributors(client, repositories, csv_name) | ||
if (args.e): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
скобки не нужны тут
if args.e:
writer.writerow(info) | ||
|
||
|
||
def log_repository_contributors(repository: Repository, csv_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тайп хинты это здорово
может их указывать для всех аргументов функций, а не только для некоторых?)
'node_id': contributor.node_id, | ||
'type': contributor.type, | ||
'bio': EMPTY_FIELD if contributor.bio is None else contributor.bio, | ||
'site_admin': contributor.site_admin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше в конце ставить запятую
объясняю почему
было так
a = [
1,
2,
3
]
стало так
a = [
1,
2,
3,
4
]
по диффу изменилось 2 строки. 1 добавилась, а другая изменилась, хотя мы только добавили строку.
преждевременная запятая способствует более чистому диффу)
'node_id', | ||
'type', | ||
'bio', | ||
'site_admin' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
про запятую подумайте :)
@@ -488,3 +488,59 @@ def log_commits(client: Github, repositories, csv_name, start, finish, branch): | |||
sleep(timedelta) | |||
except Exception as e: | |||
print(e) | |||
|
|||
def log_contributors_to_csv(info, csv_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может стоит добавить тайп хинты?)
info_tmp = { | ||
'repository name': repository.full_name, | ||
'login': contributor.login, | ||
'name': EMPTY_FIELD if contributor.name is None else contributor.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в оракле есть функция nvl https://oracleplsql.ru/nvl-function.html
кажется тут она напрашивается, чтобы вызвать её столько раз сколько нужно, а то для каждого nullable поля писать такой тернарный оператор долго :)
} | ||
log_contributors_to_csv(info_tmp, csv_name) | ||
print(info_tmp) | ||
sleep(timedelta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это из-за ограничений апи нужно?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+посмотрел по коду и понял, что это константа, может стоит капсом назвать её?
) | ||
) | ||
for repo in get_next_repo(client, repositories): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
удалить?
try: | ||
log_repository_contributors(repo, csv_name) | ||
sleep(timedelta) | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а нам точно все исключение нужно перехватывать?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в ридми нет инфы про то, как должен выглядеть список репозиториев
я по дурости сунул туда ссылки на репозитории
а надо не ссылки
так надо thehighestmath/python-code-check-system
а так не надо https://github.com/thehighestmath/python-code-check-system
можете, пожалуйста, добавить это в ридми?
+прошу Вас добавить .gitignore, чтобы случайный |
feature-request, хотя это можно в отдельной задаче сделать
|
No description provided.