mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-03-31 10:27:39 +03:00
Update linter configuration
This commit is contained in:
parent
aaaacba916
commit
f845cffeac
5 changed files with 54 additions and 36 deletions
13
.github/workflows/lint.yml
vendored
13
.github/workflows/lint.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Lint
|
||||
name: lint
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -24,16 +24,17 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
go-version: ^1.23
|
||||
- name: Cache go module
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/go/pkg/mod
|
||||
key: go-${{ hashFiles('**/go.sum') }}
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
version: latest
|
||||
version: latest
|
||||
args: .
|
|
@ -1,4 +1,4 @@
|
|||
name: Debug build
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -16,7 +16,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Linux Debug build
|
||||
name: Linux
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -24,14 +24,14 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
go-version: ^1.23
|
||||
- name: Build
|
||||
run: |
|
||||
make test
|
||||
build_go120:
|
||||
name: Linux Debug build (Go 1.20)
|
||||
name: Linux (Go 1.20)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -39,7 +39,7 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ~1.20
|
||||
continue-on-error: true
|
||||
|
@ -47,7 +47,7 @@ jobs:
|
|||
run: |
|
||||
make test
|
||||
build_go121:
|
||||
name: Linux Debug build (Go 1.21)
|
||||
name: Linux (Go 1.21)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -55,15 +55,31 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ~1.21
|
||||
continue-on-error: true
|
||||
- name: Build
|
||||
run: |
|
||||
make test
|
||||
build__windows:
|
||||
name: Windows Debug build
|
||||
build_go122:
|
||||
name: Linux (Go 1.22)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ~1.22
|
||||
continue-on-error: true
|
||||
- name: Build
|
||||
run: |
|
||||
make test
|
||||
build_windows:
|
||||
name: Windows
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -71,15 +87,15 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
go-version: ^1.23
|
||||
continue-on-error: true
|
||||
- name: Build
|
||||
run: |
|
||||
make test
|
||||
build_darwin:
|
||||
name: macOS Debug build
|
||||
name: macOS
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -87,9 +103,9 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ^1.22
|
||||
go-version: ^1.23
|
||||
continue-on-error: true
|
||||
- name: Build
|
||||
run: |
|
|
@ -3,18 +3,18 @@ linters:
|
|||
enable:
|
||||
- gofumpt
|
||||
- govet
|
||||
# - gci
|
||||
- gci
|
||||
- staticcheck
|
||||
|
||||
issues:
|
||||
exclude-dirs:
|
||||
- internal
|
||||
- paralleltest
|
||||
- ineffassign
|
||||
|
||||
linters-settings:
|
||||
# gci:
|
||||
# sections:
|
||||
# - standard
|
||||
# - prefix(github.com/sagernet/sing)
|
||||
# - default
|
||||
staticcheck:
|
||||
go: '1.19'
|
||||
gci:
|
||||
custom-order: true
|
||||
sections:
|
||||
- standard
|
||||
- prefix(github.com/sagernet/)
|
||||
- default
|
||||
|
||||
run:
|
||||
go: "1.23"
|
3
Makefile
3
Makefile
|
@ -27,4 +27,5 @@ lint_install:
|
|||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
|
||||
test:
|
||||
go test -v .
|
||||
go build -v .
|
||||
#go test -v .
|
||||
|
|
|
@ -712,7 +712,7 @@ func (t *NativeTun) rules() []*netlink.Rule {
|
|||
it.Family = unix.AF_INET
|
||||
rules = append(rules, it)
|
||||
}
|
||||
priority++
|
||||
// priority++
|
||||
}
|
||||
if p6 {
|
||||
it = netlink.NewRule()
|
||||
|
@ -755,7 +755,7 @@ func (t *NativeTun) rules() []*netlink.Rule {
|
|||
it.Table = t.options.IPRoute2TableIndex
|
||||
it.Family = unix.AF_INET6
|
||||
rules = append(rules, it)
|
||||
priority6++
|
||||
// priority6++
|
||||
}
|
||||
if p4 {
|
||||
it = netlink.NewRule()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue