Skip to content

Commit 1a54cff

Browse files
authored
devnet: not use volumes && linters rise bar (textileio#439)
* lint sanity Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * devnet: not use volumes Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * lints Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * not use mounts in tests Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * mount volumes opt Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com> * js gen change Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
1 parent cfa9b3a commit 1a54cff

89 files changed

Lines changed: 348 additions & 379 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/review.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v1
13-
- uses: actions-contrib/golangci-lint@v1
13+
- uses: golangci/golangci-lint-action@v1
14+
with:
15+
version: v1.27
1416
spell-check:
1517
name: spell-check
1618
runs-on: ubuntu-latest

.golangci.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,31 @@ linters-settings:
33
locale: US
44

55
linters:
6-
# please, do not use `enable-all`: it's deprecated and will be removed soon.
7-
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
8-
# disable-all: true
96
enable:
107
- golint
118
- misspell
12-
13-
# don't enable:
14-
# - gochecknoglobals
15-
# - gocognit
16-
# - godox
17-
# - maligned
18-
# - prealloc
9+
- gocyclo
10+
- bodyclose
11+
- unconvert
12+
- goconst
13+
- goimports
14+
- unparam
15+
- whitespace
16+
- godot
1917

2018
issues:
2119
exclude-use-default: false
2220

21+
exclude-rules:
22+
- path: cmd/powbench/runner/runner_test.go
23+
linters:
24+
- unused
25+
2326
run:
2427
timeout: 30m
2528
skip-files:
2629
- gateway/assets.go
2730

28-
# golangci.com configuration
29-
# https://github.com/golangci/golangci/wiki/Configuration
3031
service:
31-
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
32-
32+
golangci-lint-version: 1.27.x # use the fixed version to not introduce new linters unexpectedly
33+

api/client/asks.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"github.com/textileio/powergate/index/ask/runner"
1010
)
1111

12-
// Asks provides an API for viewing asks data
12+
// Asks provides an API for viewing asks data.
1313
type Asks struct {
1414
client rpc.RPCServiceClient
1515
}
1616

17-
// Get returns the current index of available asks
17+
// Get returns the current index of available asks.
1818
func (a *Asks) Get(ctx context.Context) (*ask.Index, error) {
1919
reply, err := a.client.Get(ctx, &rpc.GetRequest{})
2020
if err != nil {
@@ -32,7 +32,7 @@ func (a *Asks) Get(ctx context.Context) (*ask.Index, error) {
3232
}, nil
3333
}
3434

35-
// Query executes a query to retrieve active Asks
35+
// Query executes a query to retrieve active Asks.
3636
func (a *Asks) Query(ctx context.Context, query runner.Query) ([]ask.StorageAsk, error) {
3737
q := &rpc.Query{
3838
MaxPrice: query.MaxPrice,

api/client/client.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"google.golang.org/grpc"
1818
)
1919

20-
// Client provides the client api
20+
// Client provides the client api.
2121
type Client struct {
2222
Asks *Asks
2323
Miners *Miners
@@ -33,30 +33,30 @@ type Client struct {
3333

3434
type ctxKey string
3535

36-
// AuthKey is the key that should be used to set the auth token in a Context
36+
// AuthKey is the key that should be used to set the auth token in a Context.
3737
const AuthKey = ctxKey("ffstoken")
3838

39-
// TokenAuth provides token based auth
39+
// TokenAuth provides token based auth.
4040
type TokenAuth struct {
4141
secure bool
4242
}
4343

44-
// GetRequestMetadata returns request metadata that includes the auth token
44+
// GetRequestMetadata returns request metadata that includes the auth token.
4545
func (t TokenAuth) GetRequestMetadata(ctx context.Context, _ ...string) (map[string]string, error) {
4646
md := map[string]string{}
47-
token, ok := ctx.Value(ctxKey(AuthKey)).(string)
47+
token, ok := ctx.Value(AuthKey).(string)
4848
if ok && token != "" {
4949
md["X-ffs-Token"] = token
5050
}
5151
return md, nil
5252
}
5353

54-
// RequireTransportSecurity specifies if the connection should be secure
54+
// RequireTransportSecurity specifies if the connection should be secure.
5555
func (t TokenAuth) RequireTransportSecurity() bool {
5656
return t.secure
5757
}
5858

59-
// NewClient creates a client
59+
// NewClient creates a client.
6060
func NewClient(ma multiaddr.Multiaddr, opts ...grpc.DialOption) (*Client, error) {
6161
addr, err := util.TCPAddrFromMultiAddr(ma)
6262
if err != nil {
@@ -81,7 +81,7 @@ func NewClient(ma multiaddr.Multiaddr, opts ...grpc.DialOption) (*Client, error)
8181
return client, nil
8282
}
8383

84-
// Close closes the client's grpc connection and cancels any active requests
84+
// Close closes the client's grpc connection and cancels any active requests.
8585
func (c *Client) Close() error {
8686
return c.conn.Close()
8787
}

api/client/deals.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ import (
1313
"google.golang.org/grpc/status"
1414
)
1515

16-
// Deals provides an API for managing deals and storing data
16+
// Deals provides an API for managing deals and storing data.
1717
type Deals struct {
1818
client rpc.RPCServiceClient
1919
}
2020

21-
// WatchEvent is used to send data or error values for Watch
21+
// WatchEvent is used to send data or error values for Watch.
2222
type WatchEvent struct {
2323
Deal deals.DealInfo
2424
Err error
2525
}
2626

2727
// Store creates a proposal deal for data using wallet addr to all miners indicated
28-
// by dealConfigs for duration epochs
28+
// by dealConfigs for duration epochs.
2929
func (d *Deals) Store(ctx context.Context, addr string, data io.Reader, dealConfigs []deals.StorageDealConfig, minDuration uint64) ([]cid.Cid, []deals.StorageDealConfig, error) {
3030
stream, err := d.client.Store(ctx)
3131
if err != nil {
@@ -93,7 +93,7 @@ func (d *Deals) Store(ctx context.Context, addr string, data io.Reader, dealConf
9393
return cids, failedDeals, nil
9494
}
9595

96-
// Watch returnas a channel with state changes of indicated proposals
96+
// Watch returns a channel with state changes of indicated proposals.
9797
func (d *Deals) Watch(ctx context.Context, proposals []cid.Cid) (<-chan WatchEvent, error) {
9898
channel := make(chan WatchEvent)
9999
proposalStrings := make([]string, len(proposals))
@@ -145,7 +145,7 @@ func (d *Deals) Watch(ctx context.Context, proposals []cid.Cid) (<-chan WatchEve
145145
return channel, nil
146146
}
147147

148-
// Retrieve is used to fetch data from filecoin
148+
// Retrieve is used to fetch data from filecoin.
149149
func (d *Deals) Retrieve(ctx context.Context, waddr string, cid cid.Cid) (io.Reader, error) {
150150
req := &rpc.RetrieveRequest{
151151
Address: waddr,

api/client/faults.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Faults struct {
1212
client rpc.RPCServiceClient
1313
}
1414

15-
// Get returns the current index of miner faults data
15+
// Get returns the current index of miner faults data.
1616
func (s *Faults) Get(ctx context.Context) (*faults.IndexSnapshot, error) {
1717
reply, err := s.client.Get(ctx, &rpc.GetRequest{})
1818
if err != nil {

0 commit comments

Comments
 (0)