Skip to content

Commit 571b9af

Browse files
authored
Merge pull request #112 from 0x4b53/settings-per-binding
Settings per binding
2 parents af657ed + a722da3 commit 571b9af

32 files changed

+739
-805
lines changed

.codeclimate.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/pr-and-merge.yaml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ jobs:
1717
- name: Install Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: "1.22"
20+
go-version: "1.23"
2121

2222
- name: Run golangci-lint
2323
uses: golangci/golangci-lint-action@v6
2424
with:
25-
version: v1.58.1
25+
version: v1.61.0
2626

2727
tests:
2828
name: tests
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
services:
3333
rabbitmq:
34-
image: rabbitmq:3-management
34+
image: rabbitmq:4-management
3535
ports:
3636
- 5672:5672
3737
- 15672:15672
@@ -42,37 +42,7 @@ jobs:
4242
- name: Install Go
4343
uses: actions/setup-go@v5
4444
with:
45-
go-version: "1.22"
45+
go-version: "1.23"
4646

4747
- name: Test code
4848
run: go test -race -v ./...
49-
50-
coverage:
51-
name: coverage
52-
runs-on: ubuntu-latest
53-
services:
54-
rabbitmq:
55-
image: rabbitmq:3-management
56-
ports:
57-
- 5672:5672
58-
- 15672:15672
59-
60-
steps:
61-
- name: Checkout code
62-
uses: actions/checkout@v4
63-
64-
- name: Install Go
65-
uses: actions/setup-go@v5
66-
with:
67-
go-version: "1.22"
68-
69-
- name: Code Climate Coverage Action
70-
uses: paambaati/[email protected]
71-
env:
72-
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
73-
with:
74-
# Hack to resolve package:
75-
# https://github.com/paambaati/codeclimate-action/issues/109#issuecomment-751311299
76-
coverageCommand: make coverage
77-
prefix: ${{ github.event.repository.name }}
78-
coverageLocations: "${{github.workspace}}/c.out:gocov"

.golangci.yml

Lines changed: 52 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
---
2-
output:
3-
# print lines of code with issue, default is true
4-
print-issued-lines: false
5-
6-
# all available settings of specific linters
72
linters-settings:
8-
govet:
9-
enable-all: true
10-
disable:
11-
- fieldalignment
3+
stylecheck:
4+
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
5+
checks: ["all", "-ST1000"]
126
depguard:
137
rules:
148
main:
@@ -19,63 +13,59 @@ linters-settings:
1913
desc: "wrong testify package"
2014
misspell:
2115
locale: US
22-
gocritic:
23-
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run`
24-
# to see all tags and checks. Empty list by default. See
25-
# https://github.com/go-critic/go-critic#usage -> section "Tags".
26-
enabled-tags:
27-
- diagnostic
28-
- experimental
29-
- opinionated
30-
- performance
31-
- style
32-
disabled-checks:
33-
- hugeParam
34-
wsl:
35-
# Force newlines in end of case at this limit (0 = never).
36-
force-case-trailing-whitespace: 0
37-
16+
gci:
17+
sections:
18+
- standard # Standard section: captures all standard packages.
19+
- default # Default section: contains all imports that could not be matched to another section type.
20+
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
3821
linters:
39-
enable-all: true
40-
disable:
41-
- cyclop
42-
- copyloopvar
43-
- dupl
44-
- execinquery
45-
- exhaustruct
46-
- forbidigo
47-
- funlen
22+
disable-all: true
23+
enable:
24+
- asasalint
25+
- asciicheck
26+
- bidichk
27+
- depguard
28+
- errcheck
29+
- errchkjson
30+
- errorlint
31+
- exhaustive
32+
- fatcontext
4833
- gci
49-
- gocognit
50-
- gocyclo
34+
- gocritic
5135
- godox
52-
- gomnd
53-
- lll
54-
- mnd
55-
- nakedret
56-
- nlreturn
57-
- noctx
58-
- nonamedreturns
59-
- paralleltest
60-
- perfsprint
61-
- prealloc
62-
- testpackage
63-
- varnamelen
64-
- wrapcheck
65-
disable-all: false
66-
fast: false
67-
36+
- gofmt
37+
- gofumpt
38+
- goimports
39+
- gosec
40+
- govet
41+
- ineffassign
42+
- misspell
43+
- nolintlint
44+
- predeclared
45+
- reassign
46+
- sloglint
47+
- staticcheck
48+
- stylecheck
49+
- unparam
50+
- unused
51+
- usestdlibvars
52+
- wastedassign
53+
- whitespace
54+
- wsl
6855
issues:
69-
# Independently from option `exclude` we use default exclude patterns,
70-
# it can be disabled by this option. To list all
71-
# excluded by default patterns execute `golangci-lint run --help`.
72-
# Default value for this option is true.
73-
exclude-use-default: true
74-
75-
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
56+
exclude-use-default: false
57+
exclude-rules:
58+
- path: '(testing.go)|((.+)_test\.go)'
59+
linters:
60+
- errcheck
61+
- gosec
62+
- text: "Error return value of `.*\\.Close` is not checked"
63+
linters:
64+
- errcheck
65+
- text: G104
66+
linters:
67+
- gosec
68+
# Ensure that we can see all issues at once.
7669
max-issues-per-linter: 0
77-
78-
# Maximum count of issues with the same text. Set to 0 to disable. Default is
79-
# 3.
8070
max-same-issues: 0
8171
# vim: set sw=2 ts=2 et:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CURL ?= curl
22
DOCKER_COMPOSE = docker-compose
3-
GOLANGCI_VERSION = v1.58.1
3+
GOLANGCI_VERSION = v1.61.0
44
GOPATH = $(shell go env GOPATH)
55

66
all: lint test ## Run linting and testing
@@ -38,6 +38,6 @@ test: compose ## Run all tests (with race detection)
3838

3939
coverage:
4040
go test -coverprofile c.out ./...
41-
@sed -i "s%github.com/0x4b53/amqp-rpc/v4/%amqp-rpc/%" c.out
41+
@sed -i "s%github.com/0x4b53/amqp-rpc/v5/%amqp-rpc/%" c.out
4242

4343
.PHONY: all compose compose-down help hooks lint test

0 commit comments

Comments
 (0)