-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix: lint issues #5678
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
fix: lint issues #5678
Conversation
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Deploying goreleaser with
|
Latest commit: |
72616bb
|
Status: | ✅ Deploy successful! |
Preview URL: | https://60dd0903.goreleaser.pages.dev |
Branch Preview URL: | https://lint.goreleaser.pages.dev |
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5678 +/- ##
==========================================
- Coverage 82.81% 82.81% -0.01%
==========================================
Files 156 156
Lines 15585 15584 -1
==========================================
- Hits 12907 12906 -1
Misses 2111 2111
Partials 567 567 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 fixes several lint issues and improves code documentation and consistency across the codebase. Key changes include:
- Replacing assert calls with standard testing error calls in tests.
- Adding package documentation comments in multiple packages.
- Updating linters configuration in .golangci.yaml and minor refactoring for clarity.
Reviewed Changes
Copilot reviewed 122 out of 122 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
internal/client/gitlab_test.go | Changed unreachable-code assertions from assert.Empty to t.Error |
cmd/root.go | Added a package-level comment and Execute function documentation |
.golangci.yaml | Updated linter rules to prefer alternative packages |
internal/builders/common/common.go | Added package documentation comment |
internal/artifact/artifact_test.go | Replaced assert.Equal with require.Empty for clearer empty-string checks |
internal/client/client_test.go | Changed empty string equality checks to require.Empty for clarity |
internal/builders/golang/build_test.go | Adjusted equality check assertions for consistency |
internal/client/mock.go | Added documentation comments on mock client methods |
internal/exec/exec_mock.go | Renamed globals to follow unexported naming conventions |
internal/archivefiles/archivefiles.go | Simplified variable declaration in longestCommonPrefix function |
internal/client/client.go | Added new helper function NewIfToken with associated documentation |
internal/client/gitlab.go and github.go | Added default URL constants with documentation comments |
internal/client/git.go | Added a documentation comment for NewGitUploadClient |
Comments suppressed due to low confidence (1)
internal/client/gitlab_test.go:390
- Consider using t.Fatal("should not reach here") here as well to ensure the test exits immediately upon reaching an unexpected code path.
t.Error("should not reach here")
@@ -334,7 +334,7 @@ func TestGitLabCreateReleaseReleaseNotExists(t *testing.T) { | |||
return | |||
} | |||
|
|||
assert.Empty(t, "should not reach here") | |||
t.Error("should not reach here") |
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.
Consider using t.Fatal("should not reach here") instead of t.Error to immediately stop test execution when an unreachable code path is hit.
Copilot uses AI. Check for mistakes.
after merging #5678, i went on to do the same on goreleaser pro... it was... another couple hundred issues, mostly due to functions/package names. internal code does not really need to have docs. we can document where we think it makes sense, no need to enforce this. reverts #5678 --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
...
...
...