Skip to content
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

Bump golangci-lint and add linters #2382

Merged
merged 4 commits into from
Jan 17, 2025
Merged

Conversation

AnkushinDaniil
Copy link
Contributor

The most important changes include adding new linters, updating the golangci-lint version, and making minor adjustments to the codebase.

Code Quality Improvements:

  • Add nilnesserr. This linter reports that it returns a nil value error after checking some error not nil. Example:
err := do()
if err != nil {
     return err
}
err2 := do2()
if err2 != nil {
    return err
}
  • Add UseTesting linter. This linter detects functions that can be replaced by methods from the testing package. Example:
- fd, err := os.CreateTemp("", "versioned_constants_test*")
+ fd, err := os.CreateTemp(t.TempDir(), "versioned_constants_test*")

Tooling Updates:

  • Makefile: Updated golangci-lint to version v1.63.4.

Codebase Adjustments:

  • vm/vm.go: Removed the //nolint:lll directive from the marshalTxnsAndDeclaredClasses function signature.
  • vm/vm_test.go: Changed the temporary directory creation for the "not valid json" test case to use t.TempDir() for better test isolation.

@AnkushinDaniil AnkushinDaniil added the go Pull requests that update Go code label Jan 16, 2025
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.67%. Comparing base (0c6508c) to head (9af444c).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2382      +/-   ##
==========================================
- Coverage   74.69%   74.67%   -0.03%     
==========================================
  Files         110      110              
  Lines       12109    12109              
==========================================
- Hits         9045     9042       -3     
- Misses       2366     2368       +2     
- Partials      698      699       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@derrix060 derrix060 merged commit 0c9ee5a into main Jan 17, 2025
13 checks passed
@derrix060 derrix060 deleted the daniil/update-golangci-lint-1.63.4 branch January 17, 2025 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants