[PR #1552] [MERGED] add lint and test on pull_request #57313

Closed
opened 2026-04-29 11:53:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1552
Author: @mxyng
Created: 12/15/2023
Status: Merged
Merged: 1/11/2024
Merged by: @mxyng

Base: mainHead: mxyng/lint-test


📝 Commits (7)

📊 Changes

17 files changed (+141 additions, -82 deletions)

View changed files

.github/workflows/test.yaml (+78 -0)
.golangci.yaml (+27 -0)
📝 cmd/interactive.go (+1 -4)
📝 llm/ggml.go (+3 -3)
📝 llm/llama.go (+1 -48)
📝 llm/llm.go (+1 -1)
📝 progress/progress.go (+1 -3)
📝 readline/history.go (+4 -4)
📝 readline/readline.go (+1 -0)
📝 readline/readline_unix.go (+1 -1)
📝 server/download.go (+5 -4)
📝 server/images.go (+1 -0)
📝 server/manifests.go (+2 -2)
📝 server/modelpath.go (+1 -1)
📝 server/routes.go (+11 -8)
📝 server/routes_test.go (+1 -2)
📝 server/upload.go (+2 -1)

📄 Description

fixes a bug with generate where get_flags errors on ubuntu (and likely windows) when building cuda on a cuda-less system

fixes a bug in windows where /api/list does not return models correctly

both lint and test requires go generate results so do it once then propagate the artifacts to the rest of the pipeline

this enables linting with golangci-lint but doesn't go overboard with linters. it enables the default linters and only a few extra linters to catch the most egregious bugs

linting can run locally with golangci-lint

go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
golangci-lint run -v
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.55.2 golangci-lint run -v

resolves #1539


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/1552 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 12/15/2023 **Status:** ✅ Merged **Merged:** 1/11/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/lint-test` --- ### 📝 Commits (7) - [`9972531`](https://github.com/ollama/ollama/commit/997253143f36f8988c04f2bb184b0e8bb6e154d4) add lint and test on pull_request - [`acfc376`](https://github.com/ollama/ollama/commit/acfc376efda39919baeca9a8b68992b7fb74bcc0) add .golangci.yaml - [`2bb2bdd`](https://github.com/ollama/ollama/commit/2bb2bdd5d41af52a19d34cf3ee5d4148839562e5) fix lint - [`2b9892a`](https://github.com/ollama/ollama/commit/2b9892a808a56f9d2634f85907fdc5e0498000c6) fix(windows): modelpath and list - [`f95d2f2`](https://github.com/ollama/ollama/commit/f95d2f25f35c5140acbec44aaf8078c3c0526a7b) fix temporary history file permissions - [`4a33ced`](https://github.com/ollama/ollama/commit/4a33cede207fef9f23ea6fa1580fd749b3b60940) remove unused fields and functions - [`f921e26`](https://github.com/ollama/ollama/commit/f921e2696ed21e1f169ad26f69c21d0f2629840f) typo ### 📊 Changes **17 files changed** (+141 additions, -82 deletions) <details> <summary>View changed files</summary> ➕ `.github/workflows/test.yaml` (+78 -0) ➕ `.golangci.yaml` (+27 -0) 📝 `cmd/interactive.go` (+1 -4) 📝 `llm/ggml.go` (+3 -3) 📝 `llm/llama.go` (+1 -48) 📝 `llm/llm.go` (+1 -1) 📝 `progress/progress.go` (+1 -3) 📝 `readline/history.go` (+4 -4) 📝 `readline/readline.go` (+1 -0) 📝 `readline/readline_unix.go` (+1 -1) 📝 `server/download.go` (+5 -4) 📝 `server/images.go` (+1 -0) 📝 `server/manifests.go` (+2 -2) 📝 `server/modelpath.go` (+1 -1) 📝 `server/routes.go` (+11 -8) 📝 `server/routes_test.go` (+1 -2) 📝 `server/upload.go` (+2 -1) </details> ### 📄 Description fixes a bug with generate where `get_flags` errors on ubuntu (and likely windows) when building cuda on a cuda-less system fixes a bug in windows where `/api/list` does not return models correctly both lint and test requires go generate results so do it once then propagate the artifacts to the rest of the pipeline this enables linting with golangci-lint but doesn't go overboard with linters. it enables the default linters and only a few extra linters to catch the most egregious bugs linting can run locally with [golangci-lint](https://golangci-lint.run/usage/install/) ``` go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 golangci-lint run -v ``` ``` docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.55.2 golangci-lint run -v ``` resolves #1539 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 11:53:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#57313