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

workflows: switch to org-wide golangci-lint job #184

Merged
merged 2 commits into from
Sep 10, 2024
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
21 changes: 3 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,9 @@ on:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- uses: actions/setup-go@v5
with:
go-version-file: 'cmd/go.mod'
cache-dependency-path: cmd/go.sum

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
working-directory: cmd
uses: nspcc-dev/.github/.github/workflows/go-linter.yml@master
with:
workdir: cmd

codeql:
name: CodeQL
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea
.vscode
.golangci.yml
vendor
.docker/ir/out/*
!.docker/ir/out/.gitkeep
Expand Down
73 changes: 0 additions & 73 deletions .golangci.yml

This file was deleted.

9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NEOBENCH_FROM_COUNT ?= 1
NEOBENCH_TO_COUNT ?= 1
MS_PER_BLOCK ?= 0

.PHONY: help
.PHONY: help lint

# Show this help prompt
help:
Expand All @@ -36,6 +36,13 @@ help:
start.SharpFourNodesGoRPC10wrk start.SharpFourNodesGoRPC30wrk start.SharpFourNodesGoRPC100wrk \
start.SharpFourNodesGoRPC25rate start.SharpFourNodesGoRPC50rate start.SharpFourNodesGoRPC60rate start.SharpFourNodesGoRPC300rate start.SharpFourNodesGoRPC1000rate

.golangci.yml:
wget -O $@ https://github.com/nspcc-dev/.github/raw/master/.golangci.yml

# Lint Go code
lint: .golangci.yml
@cd cmd && golangci-lint run --config ../$<

# Build all images
build: gen build.node.bench build.node.go build.node.sharp build.bench

Expand Down
2 changes: 1 addition & 1 deletion cmd/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func generateSharpConfig(templatePath, storageEngine, suffix string) error {
return nil
}

func writeJSON(path string, obj interface{}) error {
func writeJSON(path string, obj any) error {
bytes, err := json.Marshal(obj)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (c *RPCClient) GetBlockCount(ctx context.Context) (int, error) {
return num, c.doRPCCall(ctx, rpc, &num, c.blockRequester)
}

func (c *RPCClient) doRPCCall(_ context.Context, call string, result interface{}, client *fasthttp.Client) error {
func (c *RPCClient) doRPCCall(_ context.Context, call string, result any, client *fasthttp.Client) error {
idx := c.inc.Add(1) % c.len

req, res := fasthttp.AcquireRequest(), fasthttp.AcquireResponse()
Expand Down
Loading