pluginctl: update to v0.1.2
This commit is contained in:
parent
a95ca8fb76
commit
35174c61a2
3 changed files with 110 additions and 48 deletions
102
.golangci.yml
102
.golangci.yml
|
@ -1,48 +1,88 @@
|
||||||
run:
|
version: "2"
|
||||||
timeout: 5m
|
|
||||||
modules-download-mode: readonly
|
|
||||||
|
|
||||||
linters-settings:
|
|
||||||
gofmt:
|
|
||||||
simplify: true
|
|
||||||
goimports:
|
|
||||||
local-prefixes: github.com/mattermost/mattermost-plugin-bridge-xmpp
|
|
||||||
govet:
|
|
||||||
check-shadowing: true
|
|
||||||
enable-all: true
|
|
||||||
disable:
|
|
||||||
- fieldalignment
|
|
||||||
misspell:
|
|
||||||
locale: US
|
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
disable-all: true
|
|
||||||
enable:
|
enable:
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- errcheck
|
- errcheck
|
||||||
- gocritic
|
- gocritic
|
||||||
- gofmt
|
|
||||||
- goimports
|
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
|
||||||
- govet
|
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- revive
|
- revive
|
||||||
- staticcheck
|
- staticcheck # Now includes gosimple and stylecheck
|
||||||
- stylecheck
|
|
||||||
- typecheck
|
- typecheck
|
||||||
- unconvert
|
- unconvert
|
||||||
- unused
|
- unused
|
||||||
- whitespace
|
- whitespace
|
||||||
|
- govet # Ensure this is included
|
||||||
|
|
||||||
|
settings:
|
||||||
|
errcheck:
|
||||||
|
# Add any errcheck settings here
|
||||||
|
exclude-functions:
|
||||||
|
- io.Copy(*bytes.Buffer)
|
||||||
|
|
||||||
|
gocritic:
|
||||||
|
enabled-tags:
|
||||||
|
- diagnostic
|
||||||
|
- experimental
|
||||||
|
- opinionated
|
||||||
|
- performance
|
||||||
|
- style
|
||||||
|
|
||||||
|
gosec:
|
||||||
|
# Add gosec settings
|
||||||
|
excludes:
|
||||||
|
- G104 # Errors unhandled
|
||||||
|
|
||||||
|
staticcheck:
|
||||||
|
# Configure staticcheck (includes gosimple/stylecheck checks)
|
||||||
|
checks: ["all"]
|
||||||
|
|
||||||
|
revive:
|
||||||
|
# Add revive rules
|
||||||
|
rules:
|
||||||
|
- name: exported
|
||||||
|
disabled: false
|
||||||
|
|
||||||
|
exclusions:
|
||||||
|
presets:
|
||||||
|
- comments
|
||||||
|
- std-error-handling
|
||||||
|
- common-false-positives
|
||||||
|
|
||||||
|
rules:
|
||||||
|
- path: '_test\.go'
|
||||||
|
linters:
|
||||||
|
- errcheck
|
||||||
|
- gosec
|
||||||
|
|
||||||
|
formatters:
|
||||||
|
enable:
|
||||||
|
- gofmt
|
||||||
|
- goimports
|
||||||
|
|
||||||
|
settings:
|
||||||
|
gofmt:
|
||||||
|
simplify: true
|
||||||
|
|
||||||
|
goimports:
|
||||||
|
local-prefixes:
|
||||||
|
- github.com/mattermost/mattermost-plugin-bridge-xmpp
|
||||||
|
|
||||||
|
output:
|
||||||
|
formats:
|
||||||
|
text:
|
||||||
|
path: stdout
|
||||||
|
colors: true
|
||||||
|
print-linter-name: true
|
||||||
|
|
||||||
|
run:
|
||||||
|
timeout: 5m
|
||||||
|
tests: true
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-rules:
|
max-issues-per-linter: 0
|
||||||
- path: server/configuration.go
|
max-same-issues: 0
|
||||||
linters:
|
fix: false
|
||||||
- unused
|
|
||||||
- path: _test\.go
|
|
||||||
linters:
|
|
||||||
- bodyclose
|
|
||||||
- scopelint # https://github.com/kyoh86/scopelint/issues/4
|
|
||||||
|
|
|
@ -2,11 +2,13 @@
|
||||||
# Testing and Quality Assurance
|
# Testing and Quality Assurance
|
||||||
# ====================================================================================
|
# ====================================================================================
|
||||||
|
|
||||||
|
GOLANGCI_LINT_BINARY = ./build/bin/golangci-lint
|
||||||
|
GOTESTSUM_BINARY = ./build/bin/gotestsum
|
||||||
|
|
||||||
## Install go tools
|
## Install go tools
|
||||||
install-go-tools:
|
install-go-tools:
|
||||||
@echo Installing go tools
|
@echo "Installing development tools..."
|
||||||
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0
|
@pluginctl tools install --bin-dir ./build/bin
|
||||||
$(GO) install gotest.tools/gotestsum@v1.7.0
|
|
||||||
|
|
||||||
## Runs eslint and golangci-lint
|
## Runs eslint and golangci-lint
|
||||||
.PHONY: check-style
|
.PHONY: check-style
|
||||||
|
@ -24,14 +26,14 @@ endif
|
||||||
ifneq ($(HAS_SERVER),)
|
ifneq ($(HAS_SERVER),)
|
||||||
@echo Running golangci-lint
|
@echo Running golangci-lint
|
||||||
$(GO) vet ./...
|
$(GO) vet ./...
|
||||||
$(GOBIN)/golangci-lint run ./...
|
$(GOLANGCI_LINT_BINARY) run ./...
|
||||||
endif
|
endif
|
||||||
|
|
||||||
## Runs any lints and unit tests defined for the server and webapp, if they exist.
|
## Runs any lints and unit tests defined for the server and webapp, if they exist.
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test: apply webapp/node_modules install-go-tools
|
test: apply webapp/node_modules install-go-tools
|
||||||
ifneq ($(HAS_SERVER),)
|
ifneq ($(HAS_SERVER),)
|
||||||
$(GOBIN)/gotestsum -- -v ./...
|
$(GOTESTSUM_BINARY) -- -v ./...
|
||||||
endif
|
endif
|
||||||
ifneq ($(HAS_WEBAPP),)
|
ifneq ($(HAS_WEBAPP),)
|
||||||
cd webapp && $(NPM) run test;
|
cd webapp && $(NPM) run test;
|
||||||
|
@ -42,7 +44,7 @@ endif
|
||||||
.PHONY: test-ci
|
.PHONY: test-ci
|
||||||
test-ci: apply webapp/node_modules install-go-tools
|
test-ci: apply webapp/node_modules install-go-tools
|
||||||
ifneq ($(HAS_SERVER),)
|
ifneq ($(HAS_SERVER),)
|
||||||
$(GOBIN)/gotestsum --format standard-verbose --junitfile report.xml -- ./...
|
$(GOTESTSUM_BINARY) --format standard-verbose --junitfile report.xml -- ./...
|
||||||
endif
|
endif
|
||||||
ifneq ($(HAS_WEBAPP),)
|
ifneq ($(HAS_WEBAPP),)
|
||||||
cd webapp && $(NPM) run test;
|
cd webapp && $(NPM) run test;
|
||||||
|
|
42
plugin.json
42
plugin.json
|
@ -29,28 +29,40 @@
|
||||||
"display_name": "XMPP Server URL",
|
"display_name": "XMPP Server URL",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"help_text": "The URL of the XMPP server to connect to (e.g., xmpp.example.com:5222)",
|
"help_text": "The URL of the XMPP server to connect to (e.g., xmpp.example.com:5222)",
|
||||||
"placeholder": "xmpp.example.com:5222"
|
"placeholder": "xmpp.example.com:5222",
|
||||||
|
"default": null,
|
||||||
|
"hosting": "",
|
||||||
|
"secret": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "XMPPUsername",
|
"key": "XMPPUsername",
|
||||||
"display_name": "XMPP Username",
|
"display_name": "XMPP Username",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"help_text": "The username for authenticating with the XMPP server",
|
"help_text": "The username for authenticating with the XMPP server",
|
||||||
"placeholder": "bridge@xmpp.example.com"
|
"placeholder": "bridge@xmpp.example.com",
|
||||||
|
"default": null,
|
||||||
|
"hosting": "",
|
||||||
|
"secret": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "XMPPPassword",
|
"key": "XMPPPassword",
|
||||||
"display_name": "XMPP Password",
|
"display_name": "XMPP Password",
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"secret": true,
|
"help_text": "The password for authenticating with the XMPP server",
|
||||||
"help_text": "The password for authenticating with the XMPP server"
|
"placeholder": "",
|
||||||
|
"default": null,
|
||||||
|
"hosting": "",
|
||||||
|
"secret": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "EnableSync",
|
"key": "EnableSync",
|
||||||
"display_name": "Enable Message Synchronization",
|
"display_name": "Enable Message Synchronization",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"help_text": "When enabled, messages will be synchronized between Mattermost and XMPP",
|
"help_text": "When enabled, messages will be synchronized between Mattermost and XMPP",
|
||||||
"default": false
|
"placeholder": "",
|
||||||
|
"default": false,
|
||||||
|
"hosting": "",
|
||||||
|
"secret": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "XMPPUsernamePrefix",
|
"key": "XMPPUsernamePrefix",
|
||||||
|
@ -58,7 +70,9 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"help_text": "Prefix for XMPP users in Mattermost (e.g., 'xmpp' creates usernames like 'xmpp:user@domain')",
|
"help_text": "Prefix for XMPP users in Mattermost (e.g., 'xmpp' creates usernames like 'xmpp:user@domain')",
|
||||||
"placeholder": "xmpp",
|
"placeholder": "xmpp",
|
||||||
"default": "xmpp"
|
"default": "xmpp",
|
||||||
|
"hosting": "",
|
||||||
|
"secret": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "XMPPResource",
|
"key": "XMPPResource",
|
||||||
|
@ -66,20 +80,26 @@
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"help_text": "XMPP resource identifier for the bridge client",
|
"help_text": "XMPP resource identifier for the bridge client",
|
||||||
"placeholder": "mattermost-bridge",
|
"placeholder": "mattermost-bridge",
|
||||||
"default": "mattermost-bridge"
|
"default": "mattermost-bridge",
|
||||||
|
"hosting": "",
|
||||||
|
"secret": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"key": "XMPPInsecureSkipVerify",
|
"key": "XMPPInsecureSkipVerify",
|
||||||
"display_name": "Skip TLS Certificate Verification",
|
"display_name": "Skip TLS Certificate Verification",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"help_text": "Skip TLS certificate verification for XMPP connections (use only for testing/development)",
|
"help_text": "Skip TLS certificate verification for XMPP connections (use only for testing/development)",
|
||||||
"default": false
|
"placeholder": "",
|
||||||
|
"default": false,
|
||||||
|
"hosting": "",
|
||||||
|
"secret": false
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"sections": null
|
||||||
},
|
},
|
||||||
"props": {
|
"props": {
|
||||||
"pluginctl": {
|
"pluginctl": {
|
||||||
"version": "v0.1.1"
|
"version": "v0.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue