Skip to content
Open
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
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true

[*.go]
indent_style = tab

[{*.js,*.jsx,*.ts,*.tsx,*.json,*.html}]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab

[*.md]
indent_style = space
indent_size = 4
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ on:

jobs:
plugin-cd:
uses: mattermost/actions-workflows/.github/workflows/community-plugin-cd.yml@d9defa3e455bdbf889573e112ad8d05b91d66b4c
uses: mattermost/actions-workflows/.github/workflows/community-plugin-cd.yml@main
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ on:

jobs:
plugin-ci:
uses: mattermost/actions-workflows/.github/workflows/community-plugin-ci.yml@139a051e8651e6246e3764fe342297b73120e590
uses: mattermost/actions-workflows/.github/workflows/community-plugin-ci.yml@main
secrets: inherit
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dist
build/bin
bin/
90 changes: 54 additions & 36 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,74 @@
version: "2"

run:
timeout: 5m
modules-download-mode: readonly

linters-settings:
goconst:
min-len: 2
min-occurrences: 2
gofmt:
simplify: true
goimports:
local-prefixes: github.com/mattermost/mattermost-plugin-antivirus
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
misspell:
locale: US

linters:
disable-all: true
default: none
enable:
- bidichk
- bodyclose
- errcheck
- goconst
- gocritic
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- makezero
- misspell
- modernize
- nakedret
- revive
- staticcheck
- stylecheck
- typecheck
- unconvert
- unqueryvet
- unused
- whitespace
settings:
govet:
enable-all: true
disable:
- fieldalignment
misspell:
locale: US
revive:
rules:
- name: exported
disabled: true
- name: unused-parameter
disabled: true
unqueryvet:
check-sql-builders: true
exclusions:
rules:
- path: server/manifest.go
linters:
- unused
- path: server/configuration.go
linters:
- unused
- path: _test\.go
linters:
- bodyclose
- path: build/
linters:
- errcheck
- gosec
- staticcheck

issues:
exclude-rules:
- path: server/manifest.go
linters:
- unused
- path: server/configuration.go
linters:
- unused
- path: _test\.go
linters:
- bodyclose
- goconst
- scopelint # https://github.com/kyoh86/scopelint/issues/4
formatters:
enable:
- gofmt
- gofumpt
- goimports
settings:
gofmt:
simplify: true
rewrite-rules:
- pattern: interface{}
replacement: any
gofumpt:
extra-rules: true
goimports:
local-prefixes:
- github.com/mattermost/mattermost-plugin-antivirus
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14.21.1
20.11
18 changes: 18 additions & 0 deletions .vscode/settings.json
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated file?

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"go.lintTool": "golangci-lint",
"go.lintFlags": [
"--fast"
],
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"[go]": {
"editor.defaultFormatter": "golang.go"
},
"go.useLanguageServer": true,
"gopls": {
"ui.semanticTokens": true,
"formatting.gofumpt": true
}
}
Loading