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
2 changes: 1 addition & 1 deletion .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
go-test:
strategy:
matrix:
go-version: [1.24.1]
go-version: ['1.25']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.1
go-version: '1.25'
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: ./dev/go-lint.sh
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.1
go-version: '1.25'
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- name: Check GoReleaser config
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.1
go-version: 1.25
- name: Enable pulling Go modules from private sourcegraph/sourcegraph
run: git config --global url."https://${PRIVATE_TOKEN}@github.com/sourcegraph/".insteadOf "https://github.com/sourcegraph/"
- run: go test ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24.1
go-version: 1.25

- name: Set directory to safe for git
run: git config --global --add safe.directory $GITHUB_WORKSPACE
Expand Down
102 changes: 55 additions & 47 deletions .golangci.yml
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was done by running golangci-lint migrate

Original file line number Diff line number Diff line change
@@ -1,59 +1,67 @@
# See explanation of linters at https://golangci-lint.run/usage/linters/
version: "2"
linters:
disable-all: true
default: none
enable:
- bodyclose
- depguard
- gocritic
- goimports
- gosimple
- govet
- ineffassign
- nolintlint
- staticcheck
- typecheck
- unconvert
- unused

linters-settings:
depguard:
settings:
depguard:
rules:
main:
deny:
- pkg: errors
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
- pkg: github.com/pkg/errors
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
- pkg: github.com/cockroachdb/errors
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
- pkg: github.com/hashicorp/go-multierror
desc: Use github.com/sourcegraph/sourcegraph/lib/errors instead
- pkg: io/ioutil
desc: The ioutil package has been deprecated
forbidigo:
forbid:
- pattern: fmt\.Errorf
gocritic:
disabled-checks:
- appendAssign
- assignOp
- commentFormatting
- deprecatedComment
- exitAfterDefer
- ifElseChain
- singleCaseSwitch
govet:
disable:
- composites
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
main:
deny:
- pkg: "errors"
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
- pkg: "github.com/pkg/errors"
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
- pkg: "github.com/cockroachdb/errors"
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
- pkg: "github.com/hashicorp/go-multierror"
desc: "Use github.com/sourcegraph/sourcegraph/lib/errors instead"
- pkg: "io/ioutil"
desc: "The ioutil package has been deprecated"
gocritic:
disabled-checks:
- appendAssign # Too many false positives
- assignOp # Maybe worth adding, but likely not worth the noise
- commentFormatting # No strong benefit
- deprecatedComment # Unnecessary
- exitAfterDefer # Only occurs in auxiliary tools
- ifElseChain # Noisy for not much gain
- singleCaseSwitch # Noisy for not much gain
govet:
disable:
- composites
forbidigo:
forbid:
# Use errors.New instead
- 'fmt\.Errorf'

issues:
exclude-rules:
# Exclude bodyclose lint from tests because leaking connections in tests
# is a non-issue, and checking that adds unnecessary noise
- path: _test\.go
linters:
- bodyclose

run:
timeout: 5m
- linters:
- bodyclose
path: _test\.go
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
golang 1.24.1
golang 1.25.4
shfmt 3.8.0
shellcheck 0.10.0
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#
# Nothing fancy here: we copy in the source code and build on the Alpine Go
# image. Refer to .dockerignore to get a sense of what we're not going to copy.
FROM golang:1.24.1-alpine@sha256:43c094ad24b6ac0546c62193baeb3e6e49ce14d3250845d166c77c25f64b0386 AS builder
FROM golang:1.25.4-alpine3.22@sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb AS builder

COPY . /src
WORKDIR /src
RUN go build ./cmd/src

# This stage should be kept in sync with Dockerfile.release.
FROM alpine:3.22@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412

# needed for `src code-intel upload` and `src actions exec`
RUN apk add --no-cache git
Expand Down
2 changes: 1 addition & 1 deletion dev/golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pushd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null

mkdir -p dev/.bin

version="1.64.5"
version="2.6.1"
suffix="${version}-$(go env GOOS)-$(go env GOARCH)"
target="$PWD/dev/.bin/golangci-lint-${suffix}"
url="https://github.com/golangci/golangci-lint/releases/download/v${version}/golangci-lint-${suffix}.tar.gz"
Expand Down
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/sourcegraph/src-cli

go 1.24

toolchain go1.24.1
go 1.23.12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah we probably wanted to bump the toolchain. But you know what I am being a bit silly. We should be the only people consuming this so lets just use the latest go version?


require (
cloud.google.com/go/storage v1.30.1
Expand All @@ -19,7 +17,6 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/gobwas/glob v0.2.3
github.com/google/go-cmp v0.6.0
github.com/gorilla/websocket v1.5.3
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
github.com/hexops/autogold v1.3.1
github.com/jedib0t/go-pretty/v6 v6.3.7
Expand Down Expand Up @@ -51,6 +48,7 @@ require (
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
Expand Down
Loading