Skip to content

Commit 663a90b

Browse files
committed
Add linter
1 parent da1f18f commit 663a90b

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

Diff for: .github/workflows/lint.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Write me a workflow that will lint the code with golangci-lint
2+
3+
name: lint
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- master
12+
13+
jobs:
14+
golangci:
15+
name: lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version: '1.22'
22+
cache: true
23+
# Cloning outside of workspace is currently not possible, see https://github.com/actions/checkout/issues/197
24+
# Therefore, we move later
25+
# (we need ../reva available due to a replace in the go.mod file)
26+
- name: Cloning reva
27+
uses: actions/checkout@v4
28+
with:
29+
repository: cs3org/reva
30+
path: reva
31+
- run: mv reva ../reva
32+
- name: Go mod tidy
33+
run: go mod tidy
34+
- name: golangci-lint
35+
uses: golangci/golangci-lint-action@v6
36+
with:
37+
version: latest
38+
args: --timeout=5m

Diff for: .golangci.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
linters:
2+
disable:
3+
- errcheck

Diff for: cback/http/cback.go

-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ func init() {
4848
reva.RegisterPlugin(svc{})
4949
}
5050

51-
const webdavPrefix = "/remote.php/dav/files/"
52-
5351
type config struct {
5452
Prefix string `mapstructure:"prefix"`
5553
Token string `mapstructure:"token"`

Diff for: share/sql/sql.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (m *mgr) GetShare(ctx context.Context, ref *collaboration.ShareReference) (
233233
return nil, err
234234
}
235235
default:
236-
err = errtypes.NotFound(ref.String())
236+
return nil, errtypes.NotFound(ref.String())
237237
}
238238

239239
// resolve grantee's user type if applicable

0 commit comments

Comments
 (0)