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
10 changes: 1 addition & 9 deletions .github/workflows/job-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.6"

- name: Install ack
run: sudo apt-get update && sudo apt-get install -y ack-grep
shell: bash # Explicitly use Bash because otherwise failing Windows jobs are not erroring.

- name: Install testing linting
run: make install-tools-linting
shell: bash # Explicitly use Bash because otherwise failing Windows jobs are not erroring.
go-version-file: "go.mod"

- name: Lint
run: make lint
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/job-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23.6"
go-version-file: "go.mod"

- name: Set up Java
uses: actions/setup-java@v4
Expand Down Expand Up @@ -61,7 +61,6 @@ jobs:

- name: Install testing tools
run: |
make install-tools-testing
go run scripts/github-ci/main.go
shell: bash # Explicitly use Bash because otherwise failing Windows jobs are not erroring.

Expand Down
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ ENV JAVA_HOME="/app/.eval-dev-quality/amazon-corretto-11.0.24.8.1-linux-x64"
ENV PATH="${PATH}:${JAVA_HOME}/bin"

# Install Go.
RUN wget https://go.dev/dl/go1.23.6.linux-amd64.tar.gz && \
tar -xf go1.23.6.linux-amd64.tar.gz -C /app/.eval-dev-quality/ && \
rm go1.23.6.linux-amd64.tar.gz
RUN wget https://go.dev/dl/go1.24.1.linux-amd64.tar.gz && \
tar -xf go1.24.1.linux-amd64.tar.gz -C /app/.eval-dev-quality/ && \
rm go1.24.1.linux-amd64.tar.gz
ENV PATH="${PATH}:/app/.eval-dev-quality/go/bin"
ENV GOROOT="/app/.eval-dev-quality/go"
ENV PATH="${PATH}:/home/ubuntu/go/bin"
Expand All @@ -108,5 +108,4 @@ RUN sed -i "s/args: \[\(.*\)\]/args: [\1, '--single-process']/" /home/ubuntu/.np
# Install the binary.
COPY --from=builder --chown=ubuntu:ubuntu /app/eval-dev-quality /app/.eval-dev-quality/bin/
ENV PATH="${PATH}:/app/.eval-dev-quality/bin"
RUN make install-tools-testing
RUN make install-tools /app/.eval-dev-quality/bin
25 changes: 7 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,23 @@ install: # [Go package] - # Build and install everything, or only the specified
go install -v -ldflags="$(GO_LDFLAGS)" $(PACKAGE)
.PHONY: install

install-all: install install-tools install-tools-linting install-tools-testing # Install everything for and of this repository.
install-all: install install-tools # Install everything for and of this repository.
.PHONY: install-all

install-tools: # Install tools that are required for running the evaluation.
go install -v gotest.tools/gotestsum@v1.12.1
eval-dev-quality install-tools $(if $(ARGS), --install-tools-path $(word 1,$(ARGS)))
.PHONY: install-tools

install-tools-linting: # Install tools that are used for linting.
go install -v github.com/kisielk/errcheck@v1.7.0
go install -v github.com/mgechev/revive@v1.4.0
go install -v golang.org/x/tools/cmd/deadcode@v0.27.1-0.20241219162658-575221bfbda3 # Aligned with version `gopls/v0.17.1`.
go install -v honnef.co/go/tools/cmd/staticcheck@2024.1.1
.PHONY: install-tools-linting

install-tools-testing: # Install tools that are used for testing.
go install -v github.com/vektra/mockery/v2@v2.40.3
go install -v gotest.tools/gotestsum@v1.11.0
.PHONY: install-tools-testing

generate: # Run code generation.
mockery
go tool github.com/vektra/mockery/v2
.PHONY: generate

lint: # Check repository.
errcheck ./...
go tool github.com/kisielk/errcheck ./...
go vet ./...
revive -config $(ROOT_DIR)/conf/language/golang/revive.toml -set_exit_status ./...
staticcheck ./...
go tool github.com/mgechev/revive -config $(ROOT_DIR)/conf/language/golang/revive.toml -set_exit_status ./...
go tool honnef.co/go/tools/cmd/staticcheck ./...
go run scripts/deadcode/main.go
.PHONY: lint

Expand All @@ -93,5 +82,5 @@ require-clean-worktree: # Check if there are uncommitted changes.

test: # [<Go package] - # Test everything, or only the specified package.
@# WORKAROUND We run all tests sequentially until we have a better concurrency-safe solution for Ollama.
gotestsum --format standard-verbose --hide-summary skipped -- $(NO_UNIT_TEST_CACHE) -p 1 -race -test.timeout $(UNIT_TEST_TIMEOUT)s -test.run='$(word 2,$(ARGS))' -v $(if $(ARGS), $(word 1,$(ARGS)), $(PACKAGE))
go tool gotest.tools/gotestsum --format standard-verbose --hide-summary skipped -- $(NO_UNIT_TEST_CACHE) -p 1 -race -test.timeout $(UNIT_TEST_TIMEOUT)s -test.run='$(word 2,$(ARGS))' -v $(if $(ARGS), $(word 1,$(ARGS)), $(PACKAGE))
.PHONY: test
2 changes: 1 addition & 1 deletion cmd/eval-dev-quality/cmd/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Execute(logger *log.Logger, arguments []string) {
if parser.Active == nil {
var sb strings.Builder
parser.WriteHelp(&sb)
logger.PrintfWithoutMeta(sb.String())
logger.PrintWithoutMeta(sb.String())
}
}

Expand Down
2 changes: 1 addition & 1 deletion evaluate/evaluate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ func TestEvaluate(t *testing.T) {
ExpectedResultFiles: map[string]func(t *testing.T, filePath string, data string){
"evaluation.log": nil,
filepath.Join(string(evaluatetask.IdentifierWriteTests), log.CleanModelNameForFileSystem(mockedModelID), "golang", "golang", "plain", "evaluation.log"): func(t *testing.T, filePath, data string) {
assert.Contains(t, data, "DONE 0 tests, 1 error")
assert.Contains(t, data, "DONE 0 tests, 1 failure, 1 error")
},
"evaluation.csv": nil,
},
Expand Down
2 changes: 1 addition & 1 deletion evaluate/task/transpile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ func TestTranspileRun(t *testing.T) {
},
ExpectedProblemContains: []string{
"expected 'package', found invalid",
"A fatal error happened. Please take a look at the logs", // This is `symflower fix` unable to read the broken Go file.
"expected 'package', found invalid",
},
ValidateLog: func(t *testing.T, data string) {
assert.Contains(t, data, "expected 'package', found invalid")
Expand Down
4 changes: 2 additions & 2 deletions evaluate/task/write-test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ func TestWriteTestsRun(t *testing.T) {
}
expectedProblems := []string{
"expected declaration, found this",
"unable to format source code",
"expected declaration, found this",
"unable to format source code",
"expected declaration, found this",
"expected declaration, found this",
}
validateGo(t, "Model generated test that is unfixable", &golang.Language{}, bytesutil.StringTrimIndentations(`
package plain
Expand Down
86 changes: 68 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,39 +1,89 @@
module github.com/symflower/eval-dev-quality

go 1.23.6
go 1.24.1

require (
github.com/Masterminds/semver/v3 v3.3.1
github.com/avast/retry-go v3.0.0+incompatible
github.com/jessevdk/go-flags v1.5.1-0.20210607101731-3927b71304df
github.com/google/uuid v1.6.0
github.com/jessevdk/go-flags v1.6.1
github.com/kr/pretty v0.3.1
github.com/pkg/errors v0.9.1
github.com/sashabaranov/go-openai v1.36.2-0.20250131190529-45aa99607be0
github.com/sashabaranov/go-openai v1.38.0
github.com/stretchr/testify v1.10.0
github.com/symflower/lockfile v0.0.0-20240419143922-aa3b60940c84
github.com/zimmski/osutil v1.4.0
golang.org/x/exp v0.0.0-20250207012021-f9890c6ad9f3
golang.org/x/mod v0.23.0
gonum.org/v1/gonum v0.15.0 // WORKAROUND v0.15.1 is only supported for Go 1.22+ so explicitly use v0.15.0 to stick with our older Go version.
github.com/zimmski/osutil v1.7.1
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
golang.org/x/mod v0.24.0
gonum.org/v1/gonum v0.16.0
)

require (
github.com/Masterminds/semver/v3 v3.3.1
github.com/google/uuid v1.6.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c // indirect
github.com/bitfield/gotestdox v0.2.2 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/chigopher/pathlib v0.19.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dnephin/pflag v1.0.7 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/copier v0.4.0 // indirect
github.com/kisielk/errcheck v1.9.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect
github.com/mgechev/revive v1.7.0 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/sagikazarmark/locafero v0.8.0 // indirect
github.com/schollz/progressbar/v3 v3.18.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.14.0 // indirect
github.com/spf13/cast v1.7.1 // indirect
github.com/spf13/cobra v1.9.1 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/viper v1.20.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/symflower/pretty v1.0.0 // indirect
github.com/termie/go-shutil v0.0.0-20140729215957-bcacb06fecae // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/yuin/goldmark v1.7.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/term v0.29.0 // indirect
github.com/vektra/mockery/v2 v2.53.2 // indirect
github.com/yuin/goldmark v1.7.8 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp/typeparams v0.0.0-20250305212735-054e65f0b394 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/telemetry v0.0.0-20250310203348-fdfaad844314 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/tools v0.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/gotestsum v1.12.1 // indirect
honnef.co/go/tools v0.6.1 // indirect
)

tool (
github.com/kisielk/errcheck
github.com/mgechev/revive
github.com/vektra/mockery/v2
golang.org/x/tools/cmd/deadcode
gotest.tools/gotestsum
honnef.co/go/tools/cmd/staticcheck
)
Loading
Loading