-
Couldn't load subscription status.
- Fork 71
Add label for model #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add label for model #93
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: "",
| // 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 { |
Copilot
AI
Jun 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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 |
Since long GitHub usernames can overlap with the year when creating a model, I’ve added a separate label to avoid this issue.