-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update: add bcs-webconsole-lint.yml * Update: add bcs-webconsole-lint.yml * Update: add lint.yml * Update: add lint.yml * Update: add lint.yml * Update: add bscp lint.yml * Update: fix * Update: auto fix bcs-monitor lint * Update: auto fix bcs-webconsole lint * Update: auto fix bcs-webconsole lint
- Loading branch information
Showing
40 changed files
with
477 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: lint | ||
on: [push, pull_request] | ||
jobs: | ||
bcs-webconsole: | ||
name: bcs-webconsole | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: bcs-services/bcs-webconsole/go.mod | ||
- name: go mod tidy check | ||
uses: katexochen/go-tidy-check@v2 | ||
with: | ||
modules: bcs-services/bcs-webconsole | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54.2 | ||
args: --timeout=30m --issues-exit-code=0 | ||
working-directory: bcs-services/bcs-webconsole | ||
bcs-monitor: | ||
name: bcs-monitor | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: bcs-services/bcs-monitor/go.mod | ||
- name: go mod tidy check | ||
uses: katexochen/go-tidy-check@v2 | ||
with: | ||
modules: bcs-services/bcs-monitor | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54.2 | ||
args: --timeout=30m --issues-exit-code=0 | ||
working-directory: bcs-services/bcs-monitor | ||
bcs-bscp: | ||
name: bcs-bscp | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: setup go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: bcs-services/bcs-bscp/go.mod | ||
- name: go mod tidy check | ||
uses: katexochen/go-tidy-check@v2 | ||
with: | ||
modules: bcs-services/bcs-bscp | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54.2 | ||
args: --timeout=30m --issues-exit-code=0 | ||
working-directory: bcs-services/bcs-bscp |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
# 显示所有 issue | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-use-default: false | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# enable by default | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
|
||
# custom | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goheader | ||
- goimports | ||
- gosec | ||
- misspell | ||
- nakedret | ||
- revive | ||
- unconvert | ||
- unparam | ||
|
||
linters-settings: | ||
# 只开启特定的规则 | ||
errcheck: | ||
exclude-functions: | ||
- (*os.File).Close | ||
- (io.Closer).Close | ||
- os.RemoveAll | ||
govet: | ||
check-shadowing: true | ||
gocyclo: | ||
min-complexity: 30 | ||
gosec: | ||
includes: | ||
- G201 # SQL query construction using format string | ||
- G202 # SQL query construction using string concatenation | ||
- G101 # Look for hard coded credentials | ||
- G401 # Detect the usage of DES, RC4, MD5 or SHA1 | ||
- G402 # Look for bad TLS connection settings | ||
- G403 # Ensure minimum RSA key length of 2048 bits | ||
- G404 # Insecure random number source (rand) | ||
- G504 # Import blocklist: net/http/cgi | ||
goheader: | ||
template: |- | ||
* Tencent is pleased to support the open source community by making Blueking Container Service available. | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* Licensed under the MIT License (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* http://opensource.org/licenses/MIT | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
misspell: | ||
locale: US | ||
revive: | ||
rules: | ||
- name: exported | ||
severity: warning | ||
disabled: false | ||
arguments: | ||
- checkPrivateReceivers | ||
- sayRepetitiveInsteadOfStutters | ||
- name: package-comments | ||
severity: warning | ||
disabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
# 显示所有 issue | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-use-default: false | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# enable by default | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
|
||
# custom | ||
- gci | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goheader | ||
- goimports | ||
- gosec | ||
- misspell | ||
- nakedret | ||
- revive | ||
- unconvert | ||
- unparam | ||
|
||
linters-settings: | ||
# 只开启特定的规则 | ||
errcheck: | ||
exclude-functions: | ||
- (*os.File).Close | ||
- (io.Closer).Close | ||
- (net/http.ResponseWriter).Write | ||
- io.Copy | ||
- os.RemoveAll | ||
govet: | ||
check-shadowing: true | ||
gocyclo: | ||
min-complexity: 30 | ||
goimports: | ||
local-prefixes: bscp.io | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(bscp.io) | ||
gosec: | ||
includes: | ||
- G201 # SQL query construction using format string | ||
- G202 # SQL query construction using string concatenation | ||
- G101 # Look for hard coded credentials | ||
- G401 # Detect the usage of DES, RC4, MD5 or SHA1 | ||
- G402 # Look for bad TLS connection settings | ||
- G403 # Ensure minimum RSA key length of 2048 bits | ||
- G404 # Insecure random number source (rand) | ||
- G504 # Import blocklist: net/http/cgi | ||
goheader: | ||
template: |- | ||
* Tencent is pleased to support the open source community by making Blueking Container Service available. | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* Licensed under the MIT License (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* http://opensource.org/licenses/MIT | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
misspell: | ||
locale: US | ||
revive: | ||
rules: | ||
- name: exported | ||
severity: warning | ||
disabled: false | ||
arguments: | ||
- checkPrivateReceivers | ||
- sayRepetitiveInsteadOfStutters | ||
- name: package-comments | ||
severity: warning | ||
disabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
run: | ||
timeout: 5m | ||
|
||
issues: | ||
# 显示所有 issue | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
exclude-use-default: false | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
# enable by default | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
|
||
# custom | ||
- gci | ||
- goconst | ||
- gocyclo | ||
- gofmt | ||
- goheader | ||
- goimports | ||
- gosec | ||
- misspell | ||
- nakedret | ||
- revive | ||
- unconvert | ||
- unparam | ||
|
||
linters-settings: | ||
# 只开启特定的规则 | ||
errcheck: | ||
exclude-functions: | ||
- (*os.File).Close | ||
- (io.Closer).Close | ||
- (net/http.ResponseWriter).Write | ||
- io.Copy | ||
- os.RemoveAll | ||
govet: | ||
check-shadowing: true | ||
gocyclo: | ||
min-complexity: 30 | ||
goimports: | ||
local-prefixes: github.com/Tencent/bk-bcs/bcs-services/bcs-monitor | ||
gci: | ||
sections: | ||
- standard | ||
- default | ||
- prefix(github.com/Tencent/bk-bcs/bcs-services/bcs-monitor) | ||
gosec: | ||
includes: | ||
- G201 # SQL query construction using format string | ||
- G202 # SQL query construction using string concatenation | ||
- G101 # Look for hard coded credentials | ||
- G401 # Detect the usage of DES, RC4, MD5 or SHA1 | ||
- G402 # Look for bad TLS connection settings | ||
- G403 # Ensure minimum RSA key length of 2048 bits | ||
- G404 # Insecure random number source (rand) | ||
- G504 # Import blocklist: net/http/cgi | ||
goheader: | ||
template: |- | ||
* Tencent is pleased to support the open source community by making Blueking Container Service available. | ||
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. | ||
* Licensed under the MIT License (the "License"); you may not use this file except | ||
* in compliance with the License. You may obtain a copy of the License at | ||
* http://opensource.org/licenses/MIT | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
* either express or implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
misspell: | ||
locale: US | ||
revive: | ||
rules: | ||
- name: exported | ||
severity: warning | ||
disabled: false | ||
arguments: | ||
- checkPrivateReceivers | ||
- sayRepetitiveInsteadOfStutters | ||
- name: package-comments | ||
severity: warning | ||
disabled: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.