Skip to content

tools/analyze-layer-reuse: include image date in update analysis#73

Merged
jlebon merged 1 commit intomainfrom
analyze-with-date
Feb 28, 2026
Merged

tools/analyze-layer-reuse: include image date in update analysis#73
jlebon merged 1 commit intomainfrom
analyze-with-date

Conversation

@jlebon
Copy link
Copy Markdown
Member

@jlebon jlebon commented Feb 28, 2026

Just makes it easier to understand what we're analyzing.

Just makes it easier to understand what we're analyzing.
@jlebon jlebon enabled auto-merge (rebase) February 28, 2026 02:06
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds the creation date of images to the update analysis, which is a useful enhancement for understanding the context of the analysis. The changes are well-implemented across the data structures and both human-readable and JSON outputs. I've left one comment regarding a minor maintainability improvement in the formatting of the human-readable output to avoid variable shadowing, which is a good practice to follow.

Comment on lines +236 to +239
from_created = f" ({analysis.from_created})" if analysis.from_created else ""
to_created = f" ({analysis.to_created})" if analysis.to_created else ""
lines.append(f" From: {analysis.from_ref}{from_created}")
lines.append(f" To: {analysis.to_ref}{to_created}")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The local variables from_created and to_created shadow the attributes of the analysis object. This can make the code harder to read and maintain, and could potentially lead to bugs during future refactoring. It's a good practice to use distinct names for local variables to avoid shadowing.

Suggested change
from_created = f" ({analysis.from_created})" if analysis.from_created else ""
to_created = f" ({analysis.to_created})" if analysis.to_created else ""
lines.append(f" From: {analysis.from_ref}{from_created}")
lines.append(f" To: {analysis.to_ref}{to_created}")
from_created_str = f' ({analysis.from_created})' if analysis.from_created else ''
to_created_str = f' ({analysis.to_created})' if analysis.to_created else ''
lines.append(f' From: {analysis.from_ref}{from_created_str}')
lines.append(f' To: {analysis.to_ref}{to_created_str}')

@jlebon jlebon merged commit b6b315e into main Feb 28, 2026
6 checks passed
@jlebon jlebon deleted the analyze-with-date branch February 28, 2026 02:14
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.

1 participant