Skip to content

feat: emit a warning when implicit parent conflict found - #232

Merged
niemeyer merged 8 commits into
canonical:mainfrom
letFunny:warning-implicit-parents
Jul 28, 2025
Merged

niemeyer merged 8 commits into
canonical:mainfrom
letFunny:warning-implicit-parents

Conversation

@letFunny

Copy link
Copy Markdown
Collaborator
  • Have you signed the CLA?

@github-actions

github-actions Bot commented Jul 15, 2025 •

Copy link
Copy Markdown
Command Mean [s] Min [s] Max [s] Relative
BASE 8.613 ± 0.027 8.567 8.657 1.00
HEAD 8.618 ± 0.037 8.558 8.683 1.00 ± 0.01

Comment thread internal/slicer/slicer.go
if err != nil {
return err
}
// Content created was not listed in a slice contents because extractInfo

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[Comment for reviewer]: This was an optimization which was only skipping some variable assignment and an empty for loop. It is simpler if we remove it and continue processing the path normally rather than adding the logic for finding implicit conflicts twice.

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.

Ack.

@niemeyer niemeyer 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.

Looking good. Only minors:

Comment thread internal/slicer/slicer.go Resolved
Comment thread internal/slicer/slicer.go
if err != nil {
return err
}
// Content created was not listed in a slice contents because extractInfo

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.

Ack.

Comment thread internal/slicer/slicer.go Outdated
if mode, ok := createdNotListed[relPath]; ok && mode != o.Mode {
implicitConflicts = append(implicitConflicts, relPath)
}
createdNotListed[relPath] = o.Mode

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.

Isn't inSliceContents and createdNotListed opposites of each other? If so, let's please unify terminology.

@letFunny letFunny Jul 28, 2025 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I have changed inSliceContents to listed which I think is also much simpler and enough given the context of the function and the terminology. It also matches the rest of the comments were we generally use "listed".

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.

This was the correct one apparently? That literally says "in slice contents", right? The "contents" field under the "slices" key?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, we can use that one, I just thought the other one will be too long: notInSliceContents.

Comment thread internal/slicer/slicer.go Resolved
Comment thread internal/slicer/slicer.go Resolved
Comment thread internal/slicer/suite_test.go Resolved

@niemeyer niemeyer 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.

Please see replies to your comments.

@niemeyer niemeyer 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.

Just a trivial and LGTM, thanks for the work on this.

Comment thread internal/slicer/slicer_test.go Resolved
@niemeyer
niemeyer merged commit ba4c08b into canonical:main Jul 28, 2025
@letFunny
letFunny deleted the warning-implicit-parents branch July 28, 2025 11:17
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.

3 participants