Skip to content

Commit

Permalink
chore: updated dependency versions
Browse files Browse the repository at this point in the history
this includes adding `devbox` to manage the environment dependencies
  • Loading branch information
gtramontina committed Oct 12, 2024
1 parent 1255479 commit 7bbdb52
Show file tree
Hide file tree
Showing 21 changed files with 210 additions and 48 deletions.
9 changes: 9 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Automatically sets up your devbox environment whenever you cd into this
# directory via our direnv integration:

eval "$(devbox generate direnv --print-envrc)"

# check out https://www.jetpack.io/devbox/docs/ide_configuration/direnv/
# for more details
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: '🧩 Continuous Integration'

on:
push:
branches: [ main ]
branches: [ main, upgrade-versions ]
pull_request:
branches: [ main ]

Expand All @@ -13,22 +13,22 @@ jobs:
continue-on-error: ${{ matrix.continue-on-error }}
strategy:
matrix:
go-version: [ '1.20' ]
go-version: [ '1.22' ]
continue-on-error: [ false ]
include:
- go-version: 'stable'
- go-version: 'latest'
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Devbox
uses: jetify-com/[email protected]

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
run: devbox add go@${{ matrix.go-version }}

- name: '🧹 Lint'
run: make lint
run: devbox run -- make lint

- name: '🧪 Test'
run: make test
run: devbox run -- make test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.idea/
.bin/
.devbox/
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ linters:
- structcheck
- varcheck

# to review
- depguard
- testifylint
- wsl

issues:
max-issues-per-linter: 0
max-same-issues: 0
Expand Down
8 changes: 8 additions & 0 deletions devbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.13.3/.schema/devbox.schema.json",
"packages": {
"go": "1.22.1",
"gotestsum": "1.11.0",
"golangci-lint": "1.61.0"
}
}
149 changes: 149 additions & 0 deletions devbox.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"lockfile_version": "1",
"packages": {
"[email protected]": {
"last_modified": "2024-04-02T02:53:36Z",
"resolved": "github:NixOS/nixpkgs/080a4a27f206d07724b88da096e27ef63401a504#go",
"source": "devbox-search",
"version": "1.22.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/pi4myqk3ssdk2lp6z05h3yywknlr07i5-go-1.22.1",
"default": true
}
],
"store_path": "/nix/store/pi4myqk3ssdk2lp6z05h3yywknlr07i5-go-1.22.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/f6wjnm79kazrf8qrg7wjx1va9h874j5a-go-1.22.1",
"default": true
}
],
"store_path": "/nix/store/f6wjnm79kazrf8qrg7wjx1va9h874j5a-go-1.22.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/lpn4pj00xpvjnr1zlz9xq76r686n16jy-go-1.22.1",
"default": true
}
],
"store_path": "/nix/store/lpn4pj00xpvjnr1zlz9xq76r686n16jy-go-1.22.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mzg3cka0bbr5jq96ysymwziw74fnk22m-go-1.22.1",
"default": true
}
],
"store_path": "/nix/store/mzg3cka0bbr5jq96ysymwziw74fnk22m-go-1.22.1"
}
}
},
"[email protected]": {
"last_modified": "2024-09-10T15:01:03Z",
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#golangci-lint",
"source": "devbox-search",
"version": "1.61.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/mycyzj74j3hb0z3cn93zl27vn636nzvp-golangci-lint-1.61.0",
"default": true
}
],
"store_path": "/nix/store/mycyzj74j3hb0z3cn93zl27vn636nzvp-golangci-lint-1.61.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/615pmvpwdk4a8zvysig394qyxryycvv5-golangci-lint-1.61.0",
"default": true
}
],
"store_path": "/nix/store/615pmvpwdk4a8zvysig394qyxryycvv5-golangci-lint-1.61.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/1ka14pll6a8kmvp4m3j493kaks8kf7hk-golangci-lint-1.61.0",
"default": true
}
],
"store_path": "/nix/store/1ka14pll6a8kmvp4m3j493kaks8kf7hk-golangci-lint-1.61.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/l9q9gr0500smf0wiqyv3q804ld8xdj21-golangci-lint-1.61.0",
"default": true
}
],
"store_path": "/nix/store/l9q9gr0500smf0wiqyv3q804ld8xdj21-golangci-lint-1.61.0"
}
}
},
"[email protected]": {
"last_modified": "2024-09-10T15:01:03Z",
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#gotestsum",
"source": "devbox-search",
"version": "1.11.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/gkq6wldjndpcgg3vx4la6dpp0sgmqm4y-gotestsum-1.11.0",
"default": true
}
],
"store_path": "/nix/store/gkq6wldjndpcgg3vx4la6dpp0sgmqm4y-gotestsum-1.11.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/dqj7agwyi9h11hd3775dnn66lzi5w8x2-gotestsum-1.11.0",
"default": true
}
],
"store_path": "/nix/store/dqj7agwyi9h11hd3775dnn66lzi5w8x2-gotestsum-1.11.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/f5dph9gaf4d1xni7ysdvr76i86b8p85l-gotestsum-1.11.0",
"default": true
}
],
"store_path": "/nix/store/f5dph9gaf4d1xni7ysdvr76i86b8p85l-gotestsum-1.11.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/d6wki0gr4y5b3442x496hqbnxbyd16px-gotestsum-1.11.0",
"default": true
}
],
"store_path": "/nix/store/d6wki0gr4y5b3442x496hqbnxbyd16px-gotestsum-1.11.0"
}
}
}
}
}
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gtramontina/ooze

go 1.20
go 1.22

retract (
// This version contains retractions only.
Expand All @@ -11,16 +11,16 @@ retract (
)

require (
github.com/fatih/color v1.15.0
github.com/fatih/color v1.17.0
github.com/hexops/gotextdiff v1.0.3
github.com/stretchr/testify v1.8.4
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=
github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
5 changes: 2 additions & 3 deletions internal/cmdtestrunner/cmdtestrunner_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmdtestrunner_test

import (
"os"
"path"
"testing"

Expand Down Expand Up @@ -37,11 +36,11 @@ func TestCMDTestRunner(t *testing.T) {
t.Run("makes all environment variables available to the subprocess", func(t *testing.T) {
temporaryRepository := fakerepository.NewTemporaryAt(t.TempDir())

assert.NoError(t, os.Setenv("TEST_VAR_1", "test_value_1"))
t.Setenv("TEST_VAR_1", "test_value_1")
output := cmdtestrunner.New("sh", "-c", "printf $TEST_VAR_1").Test(temporaryRepository)
assert.Equal(t, result.Err[string]("test_value_1"), output)

assert.NoError(t, os.Setenv("TEST_VAR_2", "test_value_2"))
t.Setenv("TEST_VAR_2", "test_value_2")
output = cmdtestrunner.New("sh", "-c", "printf $TEST_VAR_2").Test(temporaryRepository)
assert.Equal(t, result.Err[string]("test_value_2"), output)
})
Expand Down
16 changes: 8 additions & 8 deletions internal/consolereporter/consolereporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ func TestConsoleReporterSummary(t *testing.T) {

assert.Equal(t, []string{
"┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓",
"┃ • \033[1mTotal\033[0m: 0 ┃",
"┃ • \033[1mKilled\033[0m: 0 ┃",
"┃ • \033[1mSurvived\033[0m: 0 ┃",
"┃ • \033[1mTotal\033[22m: 0 ┃",
"┃ • \033[1mKilled\033[22m: 0 ┃",
"┃ • \033[1mSurvived\033[22m: 0 ┃",
"┠┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┨",
"┃ \033[1;32m✓ Score: 0.99 (minimum: 0.00)\033[0m ┃",
"┃ \033[1;32m✓ Score: 0.99 (minimum: 0.00)\033[22;0m ┃",
"┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛",
}, logger.LoggedLines())
})
Expand All @@ -201,11 +201,11 @@ func TestConsoleReporterSummary(t *testing.T) {

assert.Equal(t, []string{
"┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓",
"┃ • \033[1mTotal\033[0m: 0 ┃",
"┃ • \033[1mKilled\033[0m: 0 ┃",
"┃ • \033[1mSurvived\033[0m: 0 ┃",
"┃ • \033[1mTotal\033[22m: 0 ┃",
"┃ • \033[1mKilled\033[22m: 0 ┃",
"┃ • \033[1mSurvived\033[22m: 0 ┃",
"┠┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┨",
"┃ \033[1;31m⨯ Score: 0.99 (minimum: 1.00)\033[0m ┃",
"┃ \033[1;31m⨯ Score: 0.99 (minimum: 1.00)\033[22;0m ┃",
"┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛",
}, logger.LoggedLines())
})
Expand Down
2 changes: 1 addition & 1 deletion internal/fsrepository/fstemporaryrepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (r *FSTemporaryRepository) Overwrite(filePath string, data []byte) {
panic(fmt.Errorf("failed removing existing file '%s': %w", filePath, err))
}

err := os.WriteFile(fullPath, data, os.ModePerm)
err := os.WriteFile(fullPath, data, os.ModePerm) //nolint:gosec
if err != nil {
panic(fmt.Errorf("failed writing data to file '%s', %w", filePath, err))
}
Expand Down
2 changes: 1 addition & 1 deletion internal/fsrepository/fstemporaryrepository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestFSTemporaryRepository(t *testing.T) {
assert.NoError(t, err)
mask := syscall.Umask(0)
defer syscall.Umask(mask)
assert.Equal(t, os.ModePerm^os.FileMode(mask), stat.Mode())
assert.Equal(t, os.ModePerm^os.FileMode(mask), stat.Mode()) //nolint:gosec
})

t.Run("an existing linked file", func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/future/future.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func Resolved[T any](value T) Future[T] {
}

func Deferred[T any]() *DeferredFuture[T] {
return &DeferredFuture[T]{
return &DeferredFuture[T]{ //nolint:exhaustruct
channel: make(chan T),
}
}
2 changes: 1 addition & 1 deletion internal/future/future_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func TestDeferred(t *testing.T) {
})

t.Run("only one concurrent resolve calls win", func(t *testing.T) {
for i := 0; i < 1000; i++ { // arbitrary number of repetitions to try and catch concurrency issues
for range 1000 { // arbitrary number of repetitions to try and catch concurrency issues
fut := future.Deferred[int]()

go func() { fut.Resolve(10) }()
Expand Down
2 changes: 1 addition & 1 deletion internal/goinfectedfile/goinfectedfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

type Infection interface {
fmt.Stringer
Infect(func())
Infect(fn func())
}

type GoInfectedFile struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
)

func Always(score float32) ooze.ScoreCalculator {
return func(_total, _killed int) float32 {
return func(_total, _killed int) float32 { //nolint:revive
return score
}
}
2 changes: 1 addition & 1 deletion internal/prettydiff/prettydiff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestPrettyDiff(t *testing.T) {
differ := prettydiff.New(stubdiffer.New("- some removal"))
diff := differ.Diff("dummy-a.go", "dummy-b.go", []byte("dummy-a"), []byte("dummy-b"))

assert.Equal(t, "\033[1;31m- some removal\033[0m", diff)
assert.Equal(t, "\033[1;31m- some removal\033[22;0m", diff)
})

t.Run("colorizes additions", func(t *testing.T) {
Expand Down
Loading

0 comments on commit 7bbdb52

Please sign in to comment.