mirror of
https://github.com/alibaba/higress.git
synced 2026-06-02 09:07:26 +08:00
feat: add lint/e2e tests support (#126)
Signed-off-by: bitliu <bitliu@tencent.com>
This commit is contained in:
2
tools/linter/codespell/.codespell.ignorewords
Normal file
2
tools/linter/codespell/.codespell.ignorewords
Normal file
@@ -0,0 +1,2 @@
|
||||
keypair
|
||||
keypairs
|
||||
14
tools/linter/codespell/.codespell.skip
Normal file
14
tools/linter/codespell/.codespell.skip
Normal file
@@ -0,0 +1,14 @@
|
||||
.git
|
||||
.idea
|
||||
*.png
|
||||
*.woff
|
||||
*.woff2
|
||||
*.eot
|
||||
*.ttf
|
||||
*.jpg
|
||||
*.ico
|
||||
*.svg
|
||||
./docs/html/*
|
||||
go.mod
|
||||
go.sum
|
||||
bin
|
||||
26
tools/linter/codespell/matcher.json
Normal file
26
tools/linter/codespell/matcher.json
Normal 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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
46
tools/linter/golangci-lint/.golangci.yml
Normal file
46
tools/linter/golangci-lint/.golangci.yml
Normal 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
|
||||
53
tools/linter/yamllint/.yamllint
Normal file
53
tools/linter/yamllint/.yamllint
Normal 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
|
||||
Reference in New Issue
Block a user