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

Enable more golangci checks & remove revive #367

Merged
merged 1 commit into from
Oct 7, 2022
Merged

Enable more golangci checks & remove revive #367

merged 1 commit into from
Oct 7, 2022

Conversation

jtraglia
Copy link
Collaborator

@jtraglia jtraglia commented Oct 6, 2022

📝 Summary

  • Essentially, copy .golangci.yml file from go-boost-utils.
    • By default, everything is enabled. Then we disable checks we don't like.
  • Remove revive as it's run by golangci anyway.
  • Copy make lint rule from go-boost-utils/mev-boost-relay.
    • This calls gofumpt with extra checks.
    • And gofmt with simplify.
  • Fix findings from a few different linters:
    • Use go1.13 style errors.
    • Replace fmt.Info calls with log.Info calls.
    • Print version after the SetFormatter call.
    • Fix bug in relayMonitorList.String() that makezero identified.
    • Call t.Helper() at the beginning of helper functions.
    • Replace "POST" with http.MethodPost in http.NewRequest calls.

⛱ Motivation and Context

Just want to keep things consistent between the three projects.

I may review the disabled checks again later and try to fix some more stuff.

Fixes #306.


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy

@codecov-commenter
Copy link

Codecov Report

Merging #367 (e83af0e) into main (645d0ad) will increase coverage by 0.14%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main     #367      +/-   ##
==========================================
+ Coverage   81.38%   81.53%   +0.14%     
==========================================
  Files           5        5              
  Lines         677      677              
==========================================
+ Hits          551      552       +1     
+ Misses         97       96       -1     
  Partials       29       29              
Flag Coverage Δ
unittests 81.53% <80.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/utils.go 73.52% <50.00%> (+1.06%) ⬆️
server/mock_relay.go 86.92% <100.00%> (+0.08%) ⬆️
server/service.go 79.15% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@metachris
Copy link
Collaborator

Great QoL improvements, thanks 🙏

@metachris metachris merged commit a319248 into flashbots:main Oct 7, 2022
@estensen estensen mentioned this pull request Oct 7, 2022
3 tasks
screwyprof pushed a commit to screwyprof/mev-boost that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants