Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: 1.23
- uses: actions/checkout@v3
go-version: 1.26
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v7
with:
version: v1.60.3
version: v2.10.1
args: --verbose

test:
strategy:
matrix:
go-version: [1.23]
go-version: [1.26]
platform: [ubuntu-latest, macos-latest]

runs-on: ${{ matrix.platform }}
Expand Down
118 changes: 61 additions & 57 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,76 @@
linters-settings:
errcheck:
check-type-assertions: true
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
govet:
shadow: true
disable:
- fieldalignment # too strict
version: "2"

run:
timeout: 5m
issues-exit-code: 1

nolintlint:
require-explanation: false
require-specific: true
linters:
disable-all: true
enable:
- bodyclose
# - deadcode
# depguard needs to be reviewed properly and then configured, before
# it can be re-enabled.
# https://github.com/OpenPeeDeeP/depguard#example-configs
# - depguard
- copyloopvar
- dogsled
# - dupl
# correctness
- errcheck
- exhaustive
- goconst
- gocritic
- gofmt
- goimports
- gocyclo
- gosec
- gosimple
- govet
- staticcheck
- ineffassign
- misspell
- mnd
- nolintlint
- nakedret

# bug prevention
- copyloopvar
- bodyclose
- exhaustive
- unparam
- unconvert

# code quality
# - gocyclo # TODO: enable later, need to fix complexity issues
- goconst
- revive
- prealloc
- predeclared
- revive
- staticcheck
# - structcheck
- stylecheck

# security
- gosec

# testing
- thelper
- tparallel
- unconvert
- unparam
# - varcheck

# misc
- misspell
- whitespace
- wsl
- nolintlint
- dogsled

settings:
errcheck:
check-type-assertions: true

goconst:
min-len: 2
min-occurrences: 3

gocyclo:
min-complexity: 15

govet:
enable:
- shadow

revive:
severity: warning

nolintlint:
require-explanation: false
require-specific: true

exclusions:
rules:
# Ginkgo/Gomega test suites use dot-imports by convention; suppress the
# revive dot-imports warning for all test files.
- path: '_test\.go'
linters:
- revive
text: 'dot-imports'

issues:
max-issues-per-linter: 0
max-same-issues: 0
fix: true
exclude:
- "cuddle"

run:
issues-exit-code: 1
timeout: "5m"
fix: false
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"astrolib",
"Berthe",
"bodyclose",
"chzyer",
"Clonable",
"cmds",
"copyloopvar",
Expand Down Expand Up @@ -41,13 +42,16 @@
"goveralls",
"govet",
"graffico",
"ianlancetaylor",
"ineffassign",
"jibberjabber",
"leaktest",
"linters",
"logr",
"Malloc",
"mattn",
"nakedret",
"nefilim",
"nicksnyder",
"nolint",
"nolintlint",
Expand Down
3 changes: 3 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package pants provides worker-pool abstractions and utilities
// for managing concurrent jobs and their results.
package pants
3 changes: 3 additions & 0 deletions examples/fp-throttled/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package main provides an example func-based worker pool
// demonstrating throttled job submission and execution.
package main
1 change: 1 addition & 0 deletions examples/fp-throttled/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main example program
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/mf-all-output-consumed-by-range/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package main provides an example manifold-func worker pool
// where all output is consumed from an output channel.
package main
1 change: 1 addition & 0 deletions examples/mf-all-output-consumed-by-range/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main example program
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/mf-err-missing-consumer/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package main provides an example manifold-func worker pool
// demonstrating timeout-on-send when there is no output consumer.
package main
1 change: 1 addition & 0 deletions examples/mf-err-missing-consumer/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main example program
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/mf-err-timeout-on-send/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package main provides an example manifold-func worker pool
// demonstrating timeout-on-send behaviour.
package main
1 change: 1 addition & 0 deletions examples/mf-err-timeout-on-send/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main example program
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/mf-input-injected-via-chan/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package main provides an example manifold-func worker pool
// where jobs are injected via an input channel.
package main
1 change: 1 addition & 0 deletions examples/mf-input-injected-via-chan/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main example program
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/tp-throttled/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Package main provides an example task pool
// demonstrating throttled job submission and execution.
package main
1 change: 1 addition & 0 deletions examples/tp-throttled/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package main example program
package main

import (
Expand Down
37 changes: 21 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
module github.com/snivilised/pants

go 1.23.0
go 1.26.0

require (
github.com/nicksnyder/go-i18n/v2 v2.4.1
github.com/onsi/ginkgo/v2 v2.22.1
github.com/onsi/gomega v1.36.2
github.com/snivilised/li18ngo v0.1.9
github.com/nicksnyder/go-i18n/v2 v2.6.1
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/gomega v1.39.1
github.com/snivilised/li18ngo v0.1.10
)

require (
github.com/Masterminds/semver/v3 v3.4.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/sync v0.20.0 // indirect
)

require (
github.com/fortytw2/leaktest v1.3.0
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/kr/text v0.2.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260302011040-a15ffb7f9dcc // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/snivilised/nefilim v0.1.8 // indirect
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.28.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
github.com/snivilised/nefilim v0.1.11 // indirect
golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect
golang.org/x/net v0.51.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.34.0 // indirect
golang.org/x/tools v0.42.0 // indirect
)
Loading
Loading