Skip to content

Commit

Permalink
Merge pull request #112 from 0x4b53/settings-per-binding
Browse files Browse the repository at this point in the history
Settings per binding
  • Loading branch information
akarl authored Nov 7, 2024
2 parents af657ed + a722da3 commit 571b9af
Show file tree
Hide file tree
Showing 32 changed files with 739 additions and 805 deletions.
74 changes: 0 additions & 74 deletions .codeclimate.yml

This file was deleted.

38 changes: 4 additions & 34 deletions .github/workflows/pr-and-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58.1
version: v1.61.0

tests:
name: tests
Expand All @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-management
image: rabbitmq:4-management
ports:
- 5672:5672
- 15672:15672
Expand All @@ -42,37 +42,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
go-version: "1.23"

- name: Test code
run: go test -race -v ./...

coverage:
name: coverage
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
- 15672:15672

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Code Climate Coverage Action
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
# Hack to resolve package:
# https://github.com/paambaati/codeclimate-action/issues/109#issuecomment-751311299
coverageCommand: make coverage
prefix: ${{ github.event.repository.name }}
coverageLocations: "${{github.workspace}}/c.out:gocov"
114 changes: 52 additions & 62 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
---
output:
# print lines of code with issue, default is true
print-issued-lines: false

# all available settings of specific linters
linters-settings:
govet:
enable-all: true
disable:
- fieldalignment
stylecheck:
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
checks: ["all", "-ST1000"]
depguard:
rules:
main:
Expand All @@ -19,63 +13,59 @@ linters-settings:
desc: "wrong testify package"
misspell:
locale: US
gocritic:
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run`
# to see all tags and checks. Empty list by default. See
# https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- hugeParam
wsl:
# Force newlines in end of case at this limit (0 = never).
force-case-trailing-whitespace: 0

gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
linters:
enable-all: true
disable:
- cyclop
- copyloopvar
- dupl
- execinquery
- exhaustruct
- forbidigo
- funlen
disable-all: true
enable:
- asasalint
- asciicheck
- bidichk
- depguard
- errcheck
- errchkjson
- errorlint
- exhaustive
- fatcontext
- gci
- gocognit
- gocyclo
- gocritic
- godox
- gomnd
- lll
- mnd
- nakedret
- nlreturn
- noctx
- nonamedreturns
- paralleltest
- perfsprint
- prealloc
- testpackage
- varnamelen
- wrapcheck
disable-all: false
fast: false

- gofmt
- gofumpt
- goimports
- gosec
- govet
- ineffassign
- misspell
- nolintlint
- predeclared
- reassign
- sloglint
- staticcheck
- stylecheck
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- wsl
issues:
# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: true

# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
exclude-use-default: false
exclude-rules:
- path: '(testing.go)|((.+)_test\.go)'
linters:
- errcheck
- gosec
- text: "Error return value of `.*\\.Close` is not checked"
linters:
- errcheck
- text: G104
linters:
- gosec
# Ensure that we can see all issues at once.
max-issues-per-linter: 0

# Maximum count of issues with the same text. Set to 0 to disable. Default is
# 3.
max-same-issues: 0
# vim: set sw=2 ts=2 et:
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CURL ?= curl
DOCKER_COMPOSE = docker-compose
GOLANGCI_VERSION = v1.58.1
GOLANGCI_VERSION = v1.61.0
GOPATH = $(shell go env GOPATH)

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

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

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

0 comments on commit 571b9af

Please sign in to comment.