Open
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a dedicated label parameter to avoid naming collisions between GitHub usernames and years when generating models.
- Introduces a new
--labelCLI flag and corresponding function parameter - Defaults
labelto the provided or resolved username when empty - Propagates
labelthrough ASCII art and STL generation and updates tests accordingly
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/skyline/skyline.go | Added label argument to GenerateSkyline, default assignment, and passed it into ASCII/STL calls |
| cmd/skyline/skyline_test.go | Extended tests with a label field and updated calls to GenerateSkyline |
| cmd/root.go | Registered --label/-l flag and forwarded the value into GenerateSkyline |
Comments suppressed due to low confidence (2)
cmd/skyline/skyline.go:26
- Update the doc comment on
GenerateSkylineto include a description of the newlabelparameter and its behavior when empty.
// GenerateSkyline creates a 3D model with ASCII art preview of GitHub contributions for the specified year range, or "full lifetime" of the user
cmd/skyline/skyline_test.go:33
- Add a test case with a non-empty
labelvalue and assert (via mocks or expectations) that bothascii.GenerateASCIIandstl.GenerateSTLreceive the provided label rather than the default username.
label: "",
Comment on lines
26
to
28
| // GenerateSkyline creates a 3D model with ASCII art preview of GitHub contributions for the specified year range, or "full lifetime" of the user | ||
| func GenerateSkyline(startYear, endYear int, targetUser string, full bool, output string, artOnly bool) error { | ||
| func GenerateSkyline(startYear, endYear int, targetUser string, label string, full bool, output string, artOnly bool) error { |
There was a problem hiding this comment.
[nitpick] Consider refactoring GenerateSkyline to accept a configuration struct or use functional options, as the long list of positional parameters is easy to mix up and reduces readability.
156eda2 to
00f29cb
Compare
|
ami ki vaba korbo agolo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since long GitHub usernames can overlap with the year when creating a model, I’ve added a separate label to avoid this issue.