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

conform imports to schema defined in CONTRIBUTING.md #150

Merged
merged 4 commits into from
Mar 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

First, thank you for your interest in contributing to this project! Before you pick up your first issue and start
changing code, please:

1. Review all documentation for the module you're interested in.
1. Look through the [issues for this repo](https://github.com/filecoin-project/go-fil-markets/issues) for relevant discussions.
1. If you have questions about an issue, post a comment in the issue.
Expand Down Expand Up @@ -30,15 +30,15 @@ Before a PR can be merged to `master`, it must:

### Conventions and Style

#### Imports
#### Imports
We use the following import ordering.
```
import (
[stdlib packages, alpha-sorted]
<single, empty line>
[external packages]
<single, empty line>
[go-filecoin packages]
[go-fil-markets packages]
)
```

Expand All @@ -65,4 +65,4 @@ Comments are a communication to other developers (including your future self) to

- A `TODO:` comment describes a change that is desired but could not be immediately implemented. It must include a reference to a GitHub issue outlining whatever prevents the thing being done now (which could just be a matter of priority).
- A `NOTE:` comment indicates an aside, some background info, or ideas for future improvement, rather than the intent of the current code. It's often fine to document such ideas alongside the code rather than an issue (at the loss of a space for discussion).
- `FIXME`, `HACK`, `XXX` and similar tags indicating that some code is to be avoided in favour of `TODO`, `NOTE` or some straight prose.
- `FIXME`, `HACK`, `XXX` and similar tags indicating that some code is to be avoided in favour of `TODO`, `NOTE` or some straight prose.
7 changes: 5 additions & 2 deletions filestore/mocks/File.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions filestore/mocks/FileStore.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions pieceio/mocks/CarIO.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions pieceio/mocks/PieceIO.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pieceio/mocks/PreparedCar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions pieceio/mocks/ReadStore.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions pieceio/mocks/SectorCalculator.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions pieceio/mocks/WriteStore.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions pieceio/pieceio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ import (
"bytes"
"context"
"fmt"

"io"
"testing"

"github.com/filecoin-project/go-fil-markets/filestore"
fsmocks "github.com/filecoin-project/go-fil-markets/filestore/mocks"
"github.com/filecoin-project/go-fil-markets/pieceio"
"github.com/filecoin-project/go-fil-markets/pieceio/cario"
pmocks "github.com/filecoin-project/go-fil-markets/pieceio/mocks"

"github.com/filecoin-project/go-sectorbuilder"
"github.com/filecoin-project/specs-actors/actors/abi"

"github.com/ipfs/go-cid"
dag "github.com/ipfs/go-merkledag"
dstest "github.com/ipfs/go-merkledag/test"
Expand All @@ -25,6 +17,12 @@ import (
"github.com/ipld/go-ipld-prime/traversal/selector/builder"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-fil-markets/filestore"
fsmocks "github.com/filecoin-project/go-fil-markets/filestore/mocks"
"github.com/filecoin-project/go-fil-markets/pieceio"
"github.com/filecoin-project/go-fil-markets/pieceio/cario"
pmocks "github.com/filecoin-project/go-fil-markets/pieceio/mocks"
)

func Test_ThereAndBackAgain(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pieceio/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package pieceio
import (
"io"

"github.com/filecoin-project/go-fil-markets/filestore"
"github.com/filecoin-project/specs-actors/actors/abi"

blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/ipld/go-ipld-prime"

"github.com/filecoin-project/go-fil-markets/filestore"
)

type WriteStore interface {
Expand Down
2 changes: 1 addition & 1 deletion piecestore/piecestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"math/rand"
"testing"

"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
"github.com/stretchr/testify/assert"

"github.com/filecoin-project/go-fil-markets/piecestore"
"github.com/filecoin-project/go-fil-markets/shared_testutil"
"github.com/filecoin-project/specs-actors/actors/abi"
)

func TestStorePieceInfo(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion retrievalmarket/discovery/discovery.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package discovery

import (
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
cbor "github.com/ipfs/go-ipld-cbor"

"github.com/filecoin-project/go-fil-markets/retrievalmarket"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion retrievalmarket/impl/blockunsealing/blockunsealing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/rand"
"testing"

"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/ipfs/go-datastore"
dss "github.com/ipfs/go-datastore/sync"
bstore "github.com/ipfs/go-ipfs-blockstore"
Expand All @@ -22,7 +23,6 @@ import (
"github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockunsealing"
"github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes"
tut "github.com/filecoin-project/go-fil-markets/shared_testutil"
"github.com/filecoin-project/specs-actors/actors/abi"
)

func TestNewLoaderWithUnsealing(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions retrievalmarket/impl/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import (
"reflect"
"sync"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-statemachine/fsm"
"github.com/filecoin-project/specs-actors/actors/abi"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
Expand All @@ -15,14 +18,11 @@ import (
"github.com/libp2p/go-libp2p-core/peer"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/blockio"
"github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
"github.com/filecoin-project/go-fil-markets/storedcounter"
"github.com/filecoin-project/go-statemachine/fsm"
"github.com/filecoin-project/specs-actors/actors/abi"
)

var log = logging.Logger("retrieval")
Expand Down
2 changes: 1 addition & 1 deletion retrievalmarket/impl/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
dss "github.com/ipfs/go-datastore/sync"
Expand All @@ -21,7 +22,6 @@ import (
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
tut "github.com/filecoin-project/go-fil-markets/shared_testutil"
"github.com/filecoin-project/go-fil-markets/storedcounter"
"github.com/filecoin-project/specs-actors/actors/abi"
)

func TestClient_Query(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion retrievalmarket/impl/clientstates/client_fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"fmt"

"github.com/filecoin-project/go-address"
rm "github.com/filecoin-project/go-fil-markets/retrievalmarket"
"github.com/filecoin-project/go-statemachine/fsm"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"golang.org/x/xerrors"

rm "github.com/filecoin-project/go-fil-markets/retrievalmarket"
)

func recordPaymentOwed(deal *rm.ClientDealState, totalProcessed uint64, paymentOwed abi.TokenAmount) error {
Expand Down
5 changes: 3 additions & 2 deletions retrievalmarket/impl/clientstates/client_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package clientstates
import (
"context"

rm "github.com/filecoin-project/go-fil-markets/retrievalmarket"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
"github.com/filecoin-project/go-statemachine/fsm"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"

rm "github.com/filecoin-project/go-fil-markets/retrievalmarket"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
)

// ClientDealEnvironment is a bridge to the environment a client deal is executing in
Expand Down
11 changes: 5 additions & 6 deletions retrievalmarket/impl/clientstates/client_states_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,21 @@ import (
"errors"
"testing"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-statemachine/fsm"

fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin/paych"
"github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
clientstates "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/clientstates"
"github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
testnet "github.com/filecoin-project/go-fil-markets/shared_testutil"
fsmtest "github.com/filecoin-project/go-statemachine/fsm/testutil"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin/paych"
)

type consumeBlockResponse struct {
Expand Down
9 changes: 4 additions & 5 deletions retrievalmarket/impl/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ import (
"testing"
"time"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin/paych"
"github.com/ipfs/go-cid"
cidlink "github.com/ipld/go-ipld-prime/linking/cid"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/filecoin-project/go-address"

"github.com/filecoin-project/go-fil-markets/pieceio/cario"
"github.com/filecoin-project/go-fil-markets/piecestore"
"github.com/filecoin-project/go-fil-markets/retrievalmarket"
retrievalimpl "github.com/filecoin-project/go-fil-markets/retrievalmarket/impl"
"github.com/filecoin-project/go-fil-markets/retrievalmarket/impl/testnodes"
rmnet "github.com/filecoin-project/go-fil-markets/retrievalmarket/network"
tut "github.com/filecoin-project/go-fil-markets/shared_testutil"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin/paych"
)

func TestClientCanMakeQueryToProvider(t *testing.T) {
Expand Down
Loading