feat: add lint/e2e tests support (#126)

Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
Xunzhuo
2023-01-18 10:14:22 +08:00
committed by GitHub
parent 0bf395a423
commit b410fc96e3
38 changed files with 2897 additions and 19 deletions

View File

@@ -0,0 +1,2 @@
keypair
keypairs

View File

@@ -0,0 +1,14 @@
.git
.idea
*.png
*.woff
*.woff2
*.eot
*.ttf
*.jpg
*.ico
*.svg
./docs/html/*
go.mod
go.sum
bin

View File

@@ -0,0 +1,26 @@
{
"problemMatcher": [
{
"owner": "codespell-matcher-default",
"pattern": [
{
"regexp": "^(.+):(\\d+):\\s+(.+)$",
"file": 1,
"line": 2,
"message": 3
}
]
},
{
"owner": "codespell-matcher-specified",
"pattern": [
{
"regexp": "^(ERROR|WARNING):\\s+(.+):\\s+(.+?)\\s*$",
"file": 3,
"severity": 1,
"message": 2
}
]
}
]
}

View File

@@ -0,0 +1,46 @@
run:
deadline: 10m
linters:
enable:
- bodyclose
- gofmt
- goimports
- revive
- gosec
- misspell
- exportloopref
- unconvert
- unparam
- goheader
- gocritic
linters-settings:
gci:
sections:
- standard # Captures all standard packages if they do not match another section.
- default # Contains all imports that could not be matched to another section type.
- prefix(github.com/alibaba/higress/) # Groups all imports with the specified Prefix.
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/alibaba/higress/
gofmt:
simplify: true
unparam:
check-exported: false
issues:
exclude-rules:
- path: zz_generated
linters:
- goimports
- linters:
- staticcheck
text: "SA1019:"
- path: test/e2e
linters:
- bodyclose
# Show the complete output
max-issues-per-linter: 0
max-same-issues: 0

View File

@@ -0,0 +1,53 @@
---
ignore: |
rules:
braces:
min-spaces-inside: 0
max-spaces-inside: 0
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
brackets:
min-spaces-inside: 0
max-spaces-inside: 1
min-spaces-inside-empty: -1
max-spaces-inside-empty: -1
colons:
max-spaces-before: 0
max-spaces-after: 1
commas:
max-spaces-before: 1
min-spaces-after: 1
max-spaces-after: 1
comments:
level: warning
require-starting-space: true
min-spaces-from-content: 2
comments-indentation:
level: warning
document-end: disable
document-start: disable
empty-lines:
max: 2
max-start: 0
max-end: 1
empty-values:
forbid-in-block-mappings: false
forbid-in-flow-mappings: true
hyphens:
max-spaces-after: 1
indentation:
spaces: 2
indent-sequences: consistent # be consistent: don't mix indentation styles in one file.
check-multi-line-strings: false
key-duplicates: enable
key-ordering: disable
new-line-at-end-of-file: enable
new-lines:
type: unix
trailing-spaces: disable
truthy:
check-keys: false # GitHub Actions uses "on:" as a key
level: warning