mirror of https://github.com/zulip/zulip.git
mypy: Add asserts of intermediate values in update-authors-json.
This commit is contained in:
parent
2762aabad1
commit
70117f0e83
|
@ -86,13 +86,24 @@ def run_production() -> None:
|
||||||
if contribs:
|
if contribs:
|
||||||
repos_done.append(name)
|
repos_done.append(name)
|
||||||
for contrib in contribs:
|
for contrib in contribs:
|
||||||
if contrib.get('author') is None:
|
assert contrib is not None # TODO: To improve/clarify
|
||||||
|
|
||||||
|
author = contrib.get('author')
|
||||||
|
if author is None:
|
||||||
# This happens for users who've deleted their GitHub account.
|
# This happens for users who've deleted their GitHub account.
|
||||||
continue
|
continue
|
||||||
username = contrib.get('author').get('login')
|
|
||||||
|
username = author.get('login')
|
||||||
|
assert username is not None # TODO: To improve/clarify
|
||||||
|
|
||||||
|
avatar = author.get('avatar_url')
|
||||||
|
assert avatar is not None # TODO: To improve/clarify
|
||||||
|
total = contrib.get('total')
|
||||||
|
assert total is not None # TODO: To improve/clarify
|
||||||
|
|
||||||
contrib_data = {
|
contrib_data = {
|
||||||
'avatar': contrib.get('author').get('avatar_url'),
|
'avatar': avatar,
|
||||||
name: contrib.get('total'),
|
name: total,
|
||||||
}
|
}
|
||||||
if username in contribs_list:
|
if username in contribs_list:
|
||||||
contribs_list[username].update(contrib_data)
|
contribs_list[username].update(contrib_data)
|
||||||
|
|
Loading…
Reference in New Issue