-
-
Notifications
You must be signed in to change notification settings - Fork 162
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, modernize codebase #922
Conversation
Deploying nfpm with
|
Latest commit: |
577b0a8
|
Status: | ✅ Deploy successful! |
Preview URL: | https://069e4842.nfpm.pages.dev |
Branch Preview URL: | https://lint.nfpm.pages.dev |
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 modernizes the codebase by updating lint issues and refactoring tests and package fields. The changes include updating assertion functions in tests, replacing outdated references to Overridables with direct field accesses, and utilizing the Go slices package for cleaner code.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
rpm/rpm_test.go | Updated assertions using require.Len |
nfpm_test.go | Replaced require.Equal with require.Empty and direct field accesses |
nfpm.go | Refactored environment variable expansion using slices.Delete and updated field accesses |
ipk/ipk_test.go | Updated references from Overridables to direct fields |
internal/sign/pgp.go | Optimized loop iteration with range over byte slices |
internal/glob/glob_test.go | Replaced require.Equal with require.Empty for empty strings |
internal/glob/glob.go | Refactored longest common prefix logic using a helper function for min length |
files/fs.go | Replaced explicit loop with slices.Contains |
files/files_test.go | Modified loop constructs for cleanup and error checking (issue reported) |
files/files.go | Updated Sys() method signature to use any |
deprecation/deprecation.go | Updated Printf signature to accept any type |
deb/deb.go | Refactored script references from Overridables to direct fields |
arch/arch.go | Optimized isOneOf check with slices.Contains |
.golangci.yml | Updated linter configuration and added new exclusions |
} | ||
for i := 0; i < min; i++ { | ||
minlen := min(len(a), len(b)) | ||
for i := range minlen { |
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.
Using 'for i := range minlen' is invalid since minlen is an integer. Replace it with a traditional for loop such as 'for i := 0; i < minlen; i++ {'.
for i := range minlen { | |
for i := 0; i < minlen; i++ { |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -282,7 +282,7 @@ contents: | |||
errs := make(chan error, 10) | |||
t.Cleanup(func() { close(errs) }) | |||
var wg sync.WaitGroup | |||
for i := 0; i < 10; i++ { | |||
for range 10 { |
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.
The expression 'for range 10' is invalid because an integer cannot be directly ranged over. Revert to the original 'for i := 0; i < 10; i++ {' loop construct.
for range 10 { | |
for i := 0; i < 10; i++ { |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
@@ -298,7 +298,7 @@ contents: | |||
} | |||
wg.Wait() | |||
|
|||
for i := 0; i < 10; i++ { | |||
for range 10 { |
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.
The expression 'for range 10' is invalid due to 10 not being an iterable type; use a standard loop syntax, e.g., 'for i := 0; i < 10; i++ {'.
for range 10 { | |
for i := 0; i < 10; i++ { |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #922 +/- ##
==========================================
- Coverage 69.42% 69.29% -0.13%
==========================================
Files 22 22
Lines 3133 3120 -13
==========================================
- Hits 2175 2162 -13
Misses 745 745
Partials 213 213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.