Skip to content
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
11 changes: 6 additions & 5 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: amd64,arm64
## The ARM build I don't use was adding 13 minutes to my build time
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
# with:
# platforms: amd64,arm64

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
Expand Down
146 changes: 62 additions & 84 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@ run:
linters:
default: all
disable:
- asasalint
- cyclop
- decorder
- depguard
- err113
- errname
- errorlint
- exhaustive
- exhaustruct
- forbidigo
- gochecknoglobals
- godot
- godox
- goheader
- gomoddirectives
- grouper
- importas
- ireturn
- lll
- maintidx
- makezero
- mnd
- nlreturn
- noctx
- paralleltest
- prealloc
- promlinter
- revive
- tagliatelle
- testifylint
- testpackage
- thelper
- tparallel
- varnamelen
- wrapcheck
- wsl
- asasalint
- cyclop
- decorder
- depguard
- err113
- errname
- errorlint
- exhaustive
- exhaustruct
- forbidigo
- gochecknoglobals
- godot
- godox
- goheader
- gomoddirectives
- grouper
- importas
- ireturn
- lll
- maintidx
- makezero
- mnd
- nlreturn
- noctx
- paralleltest
- prealloc
- promlinter
- revive
- tagliatelle
- testifylint
- testpackage
- thelper
- tparallel
- varnamelen
- wrapcheck
- wsl
settings:
dupl:
threshold: 150
Expand All @@ -52,40 +52,18 @@ linters:
min-occurrences: 3
gocritic:
enabled-checks:
- appendAssign
- assignOp
- boolExprSimplify
- builtinShadow
- captLocal
- caseOrder
- commentedOutImport
- defaultCaseOrder
- dupArg
- dupBranchBody
- dupCase
- dupSubExpr
- elseif
- emptyFallthrough
- ifElseChain
- importShadow
- indexAlloc
- methodExprCall
- nestingReduce
- offBy1
- ptrToRefParam
- regexpMust
- singleCaseSwitch
- sloppyLen
- switchTrue
- typeSwitchVar
- typeUnparen
- underef
- unlambda
- unnecessaryBlock
- unslice
- valSwap
- wrapperFunc
- yodaStyleExpr
- boolExprSimplify
- builtinShadow
- commentedOutImport
- emptyFallthrough
- importShadow
- indexAlloc
- methodExprCall
- nestingReduce
- ptrToRefParam
- typeUnparen
- unnecessaryBlock
- yodaStyleExpr
gocyclo:
min-complexity: 15
lll:
Expand All @@ -102,32 +80,32 @@ linters:
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
- third_party$
- builtin$
- examples$
issues:
max-same-issues: 0
new-from-rev: HEAD~1
new: false
formatters:
enable:
- gofmt
- gofumpt
- goimports
- gofmt
- gofumpt
- goimports
settings:
gofmt:
simplify: true
goimports:
local-prefixes:
- github.com
- github.com
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion bridge/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
_ "image/gif"

"github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config"
Expand Down
7 changes: 3 additions & 4 deletions bridge/slack/slack.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,19 @@ func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
return nil
}

b.channels.populateChannels(true)
b.channels.populateChannels(false)

channelInfo, err := b.channels.getChannel(channel.Name)
if err != nil {
return fmt.Errorf("could not find channel: %#v", err)
}

// we can't join a channel unless we are using legacy tokens #651
// we can join a channel if we have `channels:join` scope
if !channelInfo.IsMember {
b.Log.Infof("Not currently a member of %s. Trying to join by ID (%s)", channel.Name, channelInfo.ID)
// try to join the channel
_, _, _, err := b.sc.JoinConversation(channelInfo.ID)
if err != nil {
return fmt.Errorf("the slack integration that matterbridge is using is not member of channel '%s' (and cannot join), please add it manually. %s", channelInfo.Name, err)
return fmt.Errorf("the slack integration is not member of channel '%s' (and cannot join by ID: %s), please add it manually. %s", channelInfo.Name, channelInfo.ID, err)
}
}

Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/api.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !noapi
// +build !noapi

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bdiscord.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nodiscord
// +build !nodiscord

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/birc.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !noirc
// +build !noirc

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bkeybase.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nokeybase
// +build !nokeybase

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bmatrix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nomatrix
// +build !nomatrix

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bmattermost.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nomattermost
// +build !nomattermost

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bmsteams.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nomsteams
// +build !nomsteams

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bmumble.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nomumble
// +build !nomumble

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bnctalk.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nonctalk
// +build !nonctalk

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/brocketchat.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !norocketchat
// +build !norocketchat

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bslack.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !noslack
// +build !noslack

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bsshchat.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nosshchat
// +build !nosshchat

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bsteam.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nosteam
// +build !nosteam

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/btelegram.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !notelegram
// +build !notelegram

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bvk.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !novk
// +build !novk

package bridgemap
Expand Down
4 changes: 2 additions & 2 deletions gateway/bridgemap/bwhatsapp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +build !nowhatsapp
// +build !whatsappmulti
//go:build !nowhatsapp && !whatsappmulti
// +build !nowhatsapp,!whatsappmulti

package bridgemap

Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bwhatsappmulti.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build whatsappmulti
// +build whatsappmulti

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bxmpp.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !noxmpp
// +build !noxmpp

package bridgemap
Expand Down
1 change: 1 addition & 0 deletions gateway/bridgemap/bzulip.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !nozulip
// +build !nozulip

package bridgemap
Expand Down
Loading
Loading