Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Stricter Linting #458

Merged
merged 6 commits into from
Jun 18, 2020
Merged

Stricter Linting #458

merged 6 commits into from
Jun 18, 2020

Conversation

ZenGround0
Copy link
Contributor

Enabling strict linting in CI

To start with I'm temporarily adding in an intentional err drop to reproduce lint failure.

Closes #456

@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2020

Codecov Report

Merging #458 into master will increase coverage by 0.21%.
The diff coverage is 13.63%.

@@            Coverage Diff             @@
##           master     #458      +/-   ##
==========================================
+ Coverage   46.34%   46.56%   +0.21%     
==========================================
  Files          40       40              
  Lines        4324     4304      -20     
==========================================
  Hits         2004     2004              
+ Misses       2036     2017      -19     
+ Partials      284      283       -1     

@ZenGround0 ZenGround0 marked this pull request as ready for review June 11, 2020 16:28
Copy link
Contributor

@acruikshank acruikshank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love how much this caught. Please leave requestTerminateAllDeals.

actors/builtin/miner/miner_actor.go Show resolved Hide resolved
pending, err := adt.MakeEmptyMap(adt.AsStore(rt)).Root()
if err != nil {
rt.Abortf(exitcode.ErrIllegalState, "failed to create empty map: %v", err)
}

var st State
st.Signers = signers
st.Signers = params.Signers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the linter catch this? That's pretty impressive if it did.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It caught a simpler thing which reminded me to do this here.

actors/builtin/power/power_state.go Show resolved Hide resolved
@ZenGround0 ZenGround0 force-pushed the fix/456 branch 2 times, most recently from af227ca to aea2338 Compare June 11, 2020 22:11
Copy link
Member

@anorth anorth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after changes, or ping me for any questions

.circleci/config.yml Show resolved Hide resolved
actors/builtin/market/market_state.go Show resolved Hide resolved
actors/builtin/miner/miner_state.go Outdated Show resolved Hide resolved
actors/builtin/miner/miner_state.go Outdated Show resolved Hide resolved
actors/builtin/miner/miner_state_test.go Outdated Show resolved Hide resolved
actors/builtin/market/market_state.go Outdated Show resolved Hide resolved
actors/builtin/power/power_state.go Show resolved Hide resolved
actors/builtin/power/power_state.go Outdated Show resolved Hide resolved
@@ -206,7 +206,7 @@ func TestVesting(t *testing.T) {
rt.SetCaller(anne, builtin.AccountActorCodeID)
rt.ExpectValidateCallerType(builtin.AccountActorCodeID, builtin.MultisigActorCodeID)
rt.ExpectAbort(exitcode.ErrInsufficientFunds, func() {
actor.propose(rt, darlene, abi.NewTokenAmount(100), builtin.MethodSend, fakeParams, nil)
_ = actor.propose(rt, darlene, abi.NewTokenAmount(100), builtin.MethodSend, fakeParams, nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @anorth It felt confusing to use proposeOK and approveOK in ExpectAbort clauses that we know should fail so to get around linter's errcheck on the exitcode I explicitly throw away the exitcode value within these clauses. This seems better since we're communicating that we don't care what value we get, any is wrong.

@ZenGround0
Copy link
Contributor Author

@anorth merging now with the new approveOK and proposeOK harness methods to address lint failures that showed up on the rebase. Let me know if I we should revisit this design.

@ZenGround0 ZenGround0 merged commit a8a663e into master Jun 18, 2020
aarshkshah1992 pushed a commit that referenced this pull request Jun 29, 2020
* Don't skip linting builtin

* Fix lint issues

* Proper err str fmt

* Review Response

* errcheck propose/accept harness funcs

* Don't do OK within expect abort

Co-authored-by: ZenGround0 <ZenGround0@users.noreply.github.com>
@anorth anorth deleted the fix/456 branch October 10, 2020 04:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforced static analysis of probable bugs (e.g. ignored errors)
4 participants