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:
dependabot[bot] 2025-04-29 10:43:10 -05:00 committed by GitHub
parent 914faca3a0
commit eb4dfe6700
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 92 additions and 55 deletions

View File

@ -12,8 +12,6 @@
strategy: strategy:
matrix: matrix:
go-version: go-version:
- "1.21"
- "1.22"
- "1.23" - "1.23"
- "1.24" - "1.24"
name: lint and test name: lint and test
@ -26,8 +24,8 @@
with: with:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v6.5.0 uses: golangci/golangci-lint-action@v7.0.0
with: with:
version: v1.64.5 version: v2.1.5
- name: test - name: test
run: make test_ci run: make test_ci

42
.golangci.bck.yaml Normal file
View File

@ -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

View File

@ -1,42 +1,51 @@
version: "2"
run: run:
timeout: 5m
issues-exit-code: 1 issues-exit-code: 1
tests: true tests: true
output:
issues: formats:
max-same-issues: 100 text:
include: path: stdout
- EXC0012 print-linter-name: true
- EXC0014 print-issued-lines: true
exclude-dirs: path-prefix: ""
- local
exclude-rules:
- path: example_test.go
linters:
- revive
text: "seems to be unused"
fix: true
linters: linters:
enable: enable:
- bodyclose - bodyclose
- copyloopvar - copyloopvar
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- misspell - misspell
- revive - revive
- staticcheck
- typecheck
- unused
- whitespace - whitespace
exclusions:
output: generated: lax
formats: presets:
- format: colored-line-number - common-false-positives
print-issued-lines: true - legacy
print-linter-name: true - std-error-handling
path-prefix: "" rules:
sort-results: true - 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$

View File

@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0 rev: v5.0.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-case-conflict - id: check-case-conflict
@ -12,7 +12,7 @@ repos:
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/golangci/golangci-lint - repo: https://github.com/golangci/golangci-lint
rev: v1.64.5 rev: v2.1.5
hooks: hooks:
- id: golangci-lint - id: golangci-lint
- repo: https://github.com/TekWizely/pre-commit-golang - repo: https://github.com/TekWizely/pre-commit-golang

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/go-co-op/gocron/v2 module github.com/go-co-op/gocron/v2
go 1.21.0 go 1.23.0
require ( require (
github.com/google/uuid v1.6.0 github.com/google/uuid v1.6.0

View File

@ -1626,10 +1626,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
func(t *testing.T) { func(t *testing.T) {
timeout := time.Now().Add(1 * time.Second) timeout := time.Now().Add(1 * time.Second)
var notLeaderCount int var notLeaderCount int
for { for !time.Now().After(timeout) {
if time.Now().After(timeout) {
break
}
select { select {
case <-notLeader: case <-notLeader:
notLeaderCount++ notLeaderCount++
@ -1650,10 +1647,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
func(_ *testing.T) { func(_ *testing.T) {
timeout := time.Now().Add(1 * time.Second) timeout := time.Now().Add(1 * time.Second)
var notLockedCount int var notLockedCount int
for { for !time.Now().After(timeout) {
if time.Now().After(timeout) {
break
}
select { select {
case <-notLocked: case <-notLocked:
notLockedCount++ notLockedCount++
@ -1675,10 +1669,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
func(_ *testing.T) { func(_ *testing.T) {
timeout := time.Now().Add(1 * time.Second) timeout := time.Now().Add(1 * time.Second)
var notLockedCount int var notLockedCount int
for { for !time.Now().After(timeout) {
if time.Now().After(timeout) {
break
}
select { select {
case <-notLocked: case <-notLocked:
notLockedCount++ notLockedCount++
@ -1702,10 +1693,7 @@ func TestScheduler_WithDistributed(t *testing.T) {
func(_ *testing.T) { func(_ *testing.T) {
timeout := time.Now().Add(1 * time.Second) timeout := time.Now().Add(1 * time.Second)
var notLockedCount int var notLockedCount int
for { for !time.Now().After(timeout) {
if time.Now().After(timeout) {
break
}
select { select {
case <-notLocked: case <-notLocked:
notLockedCount++ notLockedCount++