Skip to content

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

Merged
merged 10 commits into from
Mar 27, 2025
Merged

fix: lint issues #5678

merged 10 commits into from
Mar 27, 2025

Conversation

caarlos0
Copy link
Member

...

...

...

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 self-assigned this Mar 26, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 26, 2025
Copy link

cloudflare-workers-and-pages bot commented Mar 26, 2025

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: 72616bb
Status: ✅  Deploy successful!
Preview URL: https://60dd0903.goreleaser.pages.dev
Branch Preview URL: https://lint.goreleaser.pages.dev

View logs

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 88.09524% with 10 lines in your changes missing coverage. Please review.

Project coverage is 82.81%. Comparing base (16cc61c) to head (72616bb).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/exec/exec_mock.go 40.00% 6 Missing ⚠️
internal/pipe/linkedin/client.go 33.33% 1 Missing and 1 partial ⚠️
internal/pipe/webhook/webhook.go 83.33% 1 Missing ⚠️
internal/testlib/archive.go 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pull-request-size pull-request-size bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 26, 2025
@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 26, 2025
@caarlos0 caarlos0 marked this pull request as ready for review March 27, 2025 02:40
@caarlos0 caarlos0 requested a review from Copilot March 27, 2025 02:41
Copy link
Contributor

@Copilot Copilot AI left a 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")
Copy link
Preview

Copilot AI Mar 27, 2025

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.

@caarlos0 caarlos0 merged commit 28056f9 into main Mar 27, 2025
17 of 18 checks passed
@caarlos0 caarlos0 deleted the lint branch March 27, 2025 02:45
caarlos0 added a commit that referenced this pull request Mar 27, 2025
caarlos0 added a commit that referenced this pull request Mar 27, 2025
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant