Skip to content

Clean up some code and consolidate variables#1139

Merged
egibs merged 3 commits into
chainguard-dev:mainfrom
egibs:general-cleanup
Sep 26, 2025
Merged

Clean up some code and consolidate variables#1139
egibs merged 3 commits into
chainguard-dev:mainfrom
egibs:general-cleanup

Conversation

@egibs

@egibs egibs commented Sep 26, 2025

Copy link
Copy Markdown
Member

This PR consolidates some of the diff.go variables since we do the same declarations for both the source and destination variables. We also never used action.go and there were a couple of cases where we increased complexity of if statements when we could just have an earlier, separate check to return early.

refresh.go was still using filepath.Walk instead of WalkDir with the latter being much more efficient even though we aren't enumerating thousands of paths when discovering test data.

These changes shouldn't have any functional impact (i.e., make refresh-sample-testdata is a NOP).

Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
@antitree antitree self-requested a review September 26, 2025 14:17

@antitree antitree left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Built it locally and investigated some issues that Claude identified but I don't see any meaningful issues.

Comment thread pkg/action/diff.go Outdated
Signed-off-by: Evan Gibler <20933572+egibs@users.noreply.github.com>
@egibs egibs enabled auto-merge (squash) September 26, 2025 14:31
@egibs egibs merged commit f84894f into chainguard-dev:main Sep 26, 2025
12 checks passed
@egibs egibs deleted the general-cleanup branch October 31, 2025 17:51
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