mirror of https://github.com/go-co-op/gocron.git
go 1.23 & golangci-lint v2 (#843)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Roesler <johnrroesler@gmail.com>
This commit is contained in:
parent
914faca3a0
commit
eb4dfe6700
|
|
@ -12,8 +12,6 @@
|
|||
strategy:
|
||||
matrix:
|
||||
go-version:
|
||||
- "1.21"
|
||||
- "1.22"
|
||||
- "1.23"
|
||||
- "1.24"
|
||||
name: lint and test
|
||||
|
|
@ -26,8 +24,8 @@
|
|||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v6.5.0
|
||||
uses: golangci/golangci-lint-action@v7.0.0
|
||||
with:
|
||||
version: v1.64.5
|
||||
version: v2.1.5
|
||||
- name: test
|
||||
run: make test_ci
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
run:
|
||||
timeout: 5m
|
||||
issues-exit-code: 1
|
||||
tests: true
|
||||
|
||||
issues:
|
||||
max-same-issues: 100
|
||||
include:
|
||||
- EXC0012
|
||||
- EXC0014
|
||||
exclude-dirs:
|
||||
- local
|
||||
exclude-rules:
|
||||
- path: example_test.go
|
||||
linters:
|
||||
- revive
|
||||
text: "seems to be unused"
|
||||
fix: true
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- bodyclose
|
||||
- copyloopvar
|
||||
- gofumpt
|
||||
- goimports
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- revive
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- whitespace
|
||||
|
||||
output:
|
||||
formats:
|
||||
- format: colored-line-number
|
||||
print-issued-lines: true
|
||||
print-linter-name: true
|
||||
path-prefix: ""
|
||||
sort-results: true
|
||||
|
|
@ -1,42 +1,51 @@
|
|||
version: "2"
|
||||
run:
|
||||
timeout: 5m
|
||||
issues-exit-code: 1
|
||||
tests: true
|
||||
|
||||
issues:
|
||||
max-same-issues: 100
|
||||
include:
|
||||
- EXC0012
|
||||
- EXC0014
|
||||
exclude-dirs:
|
||||
- local
|
||||
exclude-rules:
|
||||
- path: example_test.go
|
||||
linters:
|
||||
- revive
|
||||
text: "seems to be unused"
|
||||
fix: true
|
||||
|
||||
output:
|
||||
formats:
|
||||
text:
|
||||
path: stdout
|
||||
print-linter-name: true
|
||||
print-issued-lines: true
|
||||
path-prefix: ""
|
||||
linters:
|
||||
enable:
|
||||
- bodyclose
|
||||
- copyloopvar
|
||||
- gofumpt
|
||||
- goimports
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- revive
|
||||
- staticcheck
|
||||
- typecheck
|
||||
- unused
|
||||
- whitespace
|
||||
|
||||
output:
|
||||
formats:
|
||||
- format: colored-line-number
|
||||
print-issued-lines: true
|
||||
print-linter-name: true
|
||||
path-prefix: ""
|
||||
sort-results: true
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
rules:
|
||||
- linters:
|
||||
- revive
|
||||
path: example_test.go
|
||||
text: seems to be unused
|
||||
- linters:
|
||||
- revive
|
||||
text: package-comments
|
||||
paths:
|
||||
- local
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
issues:
|
||||
max-same-issues: 100
|
||||
fix: true
|
||||
formatters:
|
||||
enable:
|
||||
- gofumpt
|
||||
- goimports
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- local
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
# See https://pre-commit.com/hooks.html for more hooks
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.5.0
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
|
|
@ -12,7 +12,7 @@ repos:
|
|||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/golangci/golangci-lint
|
||||
rev: v1.64.5
|
||||
rev: v2.1.5
|
||||
hooks:
|
||||
- id: golangci-lint
|
||||
- repo: https://github.com/TekWizely/pre-commit-golang
|
||||
|
|
|
|||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
|||
module github.com/go-co-op/gocron/v2
|
||||
|
||||
go 1.21.0
|
||||
go 1.23.0
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.6.0
|
||||
|
|
|
|||
|
|
@ -1626,10 +1626,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
|
|||
func(t *testing.T) {
|
||||
timeout := time.Now().Add(1 * time.Second)
|
||||
var notLeaderCount int
|
||||
for {
|
||||
if time.Now().After(timeout) {
|
||||
break
|
||||
}
|
||||
for !time.Now().After(timeout) {
|
||||
select {
|
||||
case <-notLeader:
|
||||
notLeaderCount++
|
||||
|
|
@ -1650,10 +1647,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
|
|||
func(_ *testing.T) {
|
||||
timeout := time.Now().Add(1 * time.Second)
|
||||
var notLockedCount int
|
||||
for {
|
||||
if time.Now().After(timeout) {
|
||||
break
|
||||
}
|
||||
for !time.Now().After(timeout) {
|
||||
select {
|
||||
case <-notLocked:
|
||||
notLockedCount++
|
||||
|
|
@ -1675,10 +1669,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
|
|||
func(_ *testing.T) {
|
||||
timeout := time.Now().Add(1 * time.Second)
|
||||
var notLockedCount int
|
||||
for {
|
||||
if time.Now().After(timeout) {
|
||||
break
|
||||
}
|
||||
for !time.Now().After(timeout) {
|
||||
select {
|
||||
case <-notLocked:
|
||||
notLockedCount++
|
||||
|
|
@ -1702,10 +1693,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
|
|||
func(_ *testing.T) {
|
||||
timeout := time.Now().Add(1 * time.Second)
|
||||
var notLockedCount int
|
||||
for {
|
||||
if time.Now().After(timeout) {
|
||||
break
|
||||
}
|
||||
for !time.Now().After(timeout) {
|
||||
select {
|
||||
case <-notLocked:
|
||||
notLockedCount++
|
||||
|
|
|
|||
Loading…
Reference in New Issue