Skip to content

Commit 9e12412

Browse files
Track last commit date
1 parent bd60d23 commit 9e12412

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

completion.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def get_completion(
5454
if completion:
5555
# Fetch commit from before 30 days ago and checkout
5656
try:
57+
latest_commit = clone_repo.head.commit.committed_datetime.strftime(
58+
'%Y/%m/%d %T'
59+
)
5760
commit = next(
5861
clone_repo.iter_commits('HEAD', max_count=1, before='30 days ago')
5962
)
@@ -71,10 +74,11 @@ def get_completion(
7174
).completion
7275
else:
7376
month_ago_completion = 0.0
77+
latest_commit = None
7478

7579
change = completion - month_ago_completion
7680

77-
return completion, translators_data, branch, change
81+
return completion, translators_data, branch, change, latest_commit
7882

7983

8084
@dataclass(frozen=True)

generate.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ def get_project_data(
6464
) -> 'LanguageProjectData':
6565
built = language.code in languages_built
6666
if repo:
67-
completion, translators_data, branch, change = get_completion(clones_dir, repo)
67+
completion, translators_data, branch, change, latest_commit_date = get_completion(clones_dir, repo)
6868
else:
6969
completion = 0.0
7070
translators_data = TranslatorsData(0, False)
7171
change = 0.0
7272
branch = ''
73+
latest_commit_date = None
7374
return LanguageProjectData(
7475
language,
7576
repo,
@@ -78,6 +79,7 @@ def get_project_data(
7879
change,
7980
translators_data,
8081
built,
82+
latest_commit_date,
8183
in_switcher=languages_built.get(language.code),
8284
uses_platform=language.code in contribute.pulling_from_transifex,
8385
contribution_link=contribute.get_contrib_link(language.code, repo),
@@ -93,6 +95,7 @@ class LanguageProjectData:
9395
change: float
9496
translators: TranslatorsData
9597
built: bool
98+
latest_commit_date: str | None
9699
in_switcher: bool | None
97100
uses_platform: bool
98101
contribution_link: str | None

metadata.html.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<tr>
1616
<th>language</th>
1717
<th>branch</th>
18+
<th>last updated</th>
1819
<th>build warnings*</th>
1920
<th>lint failures</th>
2021
</tr>
@@ -24,6 +25,7 @@
2425
<tr>
2526
<td data-label="language">{{ project.language.name }} ({{ project.language.code }})</td>
2627
<td data-label="branch">{{ project.branch }}</td>
28+
<td data-label="updated">{{ project.last_commit_date }}</td>
2729
<td data-label="warnings">
2830
{% if project.completion %}<a href="warnings-{{ project.language.code }}.txt">{{ metadata[0] }}</a>{% else %}{{ metadata[0] }}{% endif %}
2931
</td>

0 commit comments

Comments
 (0)