Skip to content

Commit 4df6ee3

Browse files
authored
Configure golangci-lint via yml file (textileio#249)
* configure golangci-lint via yml file Signed-off-by: Aaron Sutula <hi@asutula.com> * increase timeout Signed-off-by: Aaron Sutula <hi@asutula.com> * add reviewdog back in Signed-off-by: Aaron Sutula <hi@asutula.com> * fixing misspellings Signed-off-by: Aaron Sutula <hi@asutula.com> * clean up conf file Signed-off-by: Aaron Sutula <hi@asutula.com>
1 parent 7db4f43 commit 4df6ee3

13 files changed

Lines changed: 151 additions & 124 deletions

File tree

.github/workflows/review.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v1
1313
- uses: actions-contrib/golangci-lint@v1
14-
with:
15-
args: "run -E golint --timeout 30m --exclude-use-default=false"
1614
spell-check:
17-
name: spell-check
18-
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v1
21-
- uses: reviewdog/action-misspell@v1
22-
with:
23-
reporter: github-pr-review
24-
github_token: ${{ secrets.github_token }}
25-
locale: "US"
26-
15+
name: spell-check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v1
19+
- uses: reviewdog/action-misspell@v1
20+
with:
21+
reporter: github-pr-review
22+
github_token: ${{ secrets.github_token }}
23+
locale: "US"

.golangci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
linters-settings:
2+
misspell:
3+
locale: US
4+
5+
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
9+
enable:
10+
- golint
11+
- misspell
12+
13+
# don't enable:
14+
# - gochecknoglobals
15+
# - gocognit
16+
# - godox
17+
# - maligned
18+
# - prealloc
19+
20+
issues:
21+
exclude-use-default: false
22+
23+
run:
24+
timeout: 30m
25+
skip-files:
26+
- gateway/assets.go
27+
28+
# golangci.com configuration
29+
# https://github.com/golangci/golangci/wiki/Configuration
30+
service:
31+
golangci-lint-version: 1.23.x # use the fixed version to not introduce new linters unexpectedly
32+

deals/deals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var (
2828
// ErrRetrievalNoAvailableProviders indicates that the data isn't available on any provided
2929
// to be retrieved.
3030
ErrRetrievalNoAvailableProviders = errors.New("no providers to retrieve the data")
31-
// ErrDealNotFound indicates a particular ProposalCid from a deal isn't found on-chain. Currenty,
31+
// ErrDealNotFound indicates a particular ProposalCid from a deal isn't found on-chain. Currently,
3232
// in Lotus this indicates that it may never existed on-chain, or it existed but it already expired
3333
// (currEpoch > StartEpoch+Duration).
3434
ErrDealNotFound = errors.New("deal not found on-chain")

exe/cli/cmd/ffs_watch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ func jobsComplete(state map[string]*client.JobEvent) bool {
127127

128128
func displayName(s ffs.JobStatus) string {
129129
switch s {
130-
case ffs.Cancelled:
131-
return "Cancelled"
130+
case ffs.Canceled:
131+
return "Canceled"
132132
case ffs.Failed:
133133
return "Failed"
134134
case ffs.InProgress:

ffs/coreipfs/coreipfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (ci *CoreIpfs) Add(ctx context.Context, r io.Reader) (cid.Cid, error) {
8484

8585
// Get retrieves a cid from the IPFS node.
8686
func (ci *CoreIpfs) Get(ctx context.Context, c cid.Cid) (io.Reader, error) {
87-
log.Debugf("geting cid %s", c)
87+
log.Debugf("getting cid %s", c)
8888
n, err := ci.ipfs.Unixfs().Get(ctx, path.IpfsPath(c))
8989
if err != nil {
9090
return nil, fmt.Errorf("getting cid %s from ipfs: %s", c, err)

ffs/grpc/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
var (
19-
// ErrEmptyAuthToken is returned when the provided auth-token is unkown.
19+
// ErrEmptyAuthToken is returned when the provided auth-token is unknown.
2020
ErrEmptyAuthToken = errors.New("auth token can't be empty")
2121

2222
log = logger.Logger("ffs-grpc-service")

ffs/pb/ffs.pb.go

Lines changed: 94 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ffs/pb/ffs.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ enum JobStatus {
9999
Queued = 0;
100100
InProgress = 1;
101101
Failed = 2;
102-
Cancelled = 3;
102+
Canceled = 3;
103103
Success = 4;
104104
}
105105

ffs/types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (jid JobID) String() string {
2828
}
2929

3030
var (
31-
// EmptyInstanceID representes an empty/invalid Instance ID.
31+
// EmptyInstanceID represents an empty/invalid Instance ID.
3232
EmptyInstanceID = APIID("")
3333
)
3434

@@ -64,9 +64,9 @@ const (
6464
// Failed indicates the Job failed, with job.ErrCause with
6565
// the error cause.
6666
Failed
67-
// Cancelled indicates the Job was cancelled from Queued,
67+
// Canceled indicates the Job was canceled from Queued,
6868
// and didn't reach execution.
69-
Cancelled
69+
Canceled
7070
// Success indicates the Job was successfully executed.
7171
Success
7272
)

index/ask/ask.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (ai *Index) Close() error {
130130
return nil
131131
}
132132

133-
// start is a long running job that updates asks infromation in the market
133+
// start is a long running job that updates asks information in the market
134134
func (ai *Index) start() {
135135
defer close(ai.finished)
136136
if err := ai.update(); err != nil {
@@ -232,7 +232,7 @@ func generateIndex(ctx context.Context, api *apistruct.FullNodeStruct) (*IndexSn
232232

233233
select {
234234
case <-ctx.Done():
235-
return nil, fmt.Errorf("refresh was cancelled")
235+
return nil, fmt.Errorf("refresh was canceled")
236236
default:
237237
}
238238

0 commit comments

Comments
 (0)