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
37 changes: 10 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,8 @@ permissions:
contents: read

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Run tests
run: make test

lint:
name: Lint
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -35,18 +22,14 @@ jobs:
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin

- name: Lint
run: make lint

vet:
name: Vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Format check
run: test -z "$(gofmt -l .)"

- name: Vet
run: make vet

- name: Lint
run: make lint

- name: Test
run: make test
8 changes: 4 additions & 4 deletions internal/changeset/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ func Take(root string) (Snapshot, error) {

// Change represents a single file change.
type Change struct {
Path string `json:"path"` // relative to mount root
Type string `json:"type"` // "created", "modified", "deleted"
Path string `json:"path"` // relative to mount root
Type string `json:"type"` // "created", "modified", "deleted"
OldSize int64 `json:"old_size,omitempty"`
NewSize int64 `json:"new_size,omitempty"`
}
Expand Down Expand Up @@ -149,8 +149,8 @@ func Diff(before, after Snapshot) []Change {

// MountChanges groups changes by mount source.
type MountChanges struct {
Source string `json:"source"` // host path
Target string `json:"target"` // guest path
Source string `json:"source"` // host path
Target string `json:"target"` // guest path
Changes []Change `json:"changes"`
}

Expand Down
2 changes: 1 addition & 1 deletion internal/changeset/snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func TestFilterNoise_RemovesDirectories(t *testing.T) {
func TestFilterNoise_RemovesIgnoredPrefixes(t *testing.T) {
before := Snapshot{}
after := Snapshot{
".git/HEAD": FileEntry{Path: ".git/HEAD", Size: 40},
".git/HEAD": FileEntry{Path: ".git/HEAD", Size: 40},
".omc/state.json": FileEntry{Path: ".omc/state.json", Size: 200},
".claude/settings.json": FileEntry{Path: ".claude/settings.json", Size: 50},
"main.go": FileEntry{Path: "main.go", Size: 300},
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/prune.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

var (
pruneAll bool
pruneAll bool
pruneArtifacts bool
)

Expand Down
4 changes: 2 additions & 2 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ func TestExpandPaths(t *testing.T) {
expected: []string{filepath.Join(home, "project:rw")},
},
{
name: "multiple paths with mixed mount options",
input: []string{"~/.ssh", "~/.gitconfig:ro", "~/code:rw"},
name: "multiple paths with mixed mount options",
input: []string{"~/.ssh", "~/.gitconfig:ro", "~/code:rw"},
expected: []string{
filepath.Join(home, ".ssh"),
filepath.Join(home, ".gitconfig:ro"),
Expand Down
8 changes: 4 additions & 4 deletions internal/guest/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ func TestGenerateClaudeInitScript_DNSForcedWithAllowlist(t *testing.T) {
// This prevents the bug where DHCP sets a different DNS server that iptables then blocks.

tests := []struct {
name string
policy *network.Policy
wantDNSForced bool
wantIPTables bool
name string
policy *network.Policy
wantDNSForced bool
wantIPTables bool
}{
{
name: "domain allowlist forces DNS",
Expand Down
24 changes: 12 additions & 12 deletions internal/network/allowlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,30 @@ func TestParse(t *testing.T) {
wantDomains: []string{"registry.npmjs.org", "npmjs.com"},
},
{
name: "multiple presets",
input: []string{"npm", "github"},
wantAll: false,
name: "multiple presets",
input: []string{"npm", "github"},
wantAll: false,
wantBlocked: false,
wantDomains: []string{"registry.npmjs.org", "npmjs.com", "github.com", "api.github.com", "raw.githubusercontent.com"},
},
{
name: "preset with literal domain",
input: []string{"npm", "custom.example.com"},
wantAll: false,
name: "preset with literal domain",
input: []string{"npm", "custom.example.com"},
wantAll: false,
wantBlocked: false,
wantDomains: []string{"registry.npmjs.org", "npmjs.com", "custom.example.com"},
},
{
name: "case insensitive",
input: []string{"NPM", "GitHub"},
wantAll: false,
name: "case insensitive",
input: []string{"NPM", "GitHub"},
wantAll: false,
wantBlocked: false,
wantDomains: []string{"registry.npmjs.org", "npmjs.com", "github.com", "api.github.com", "raw.githubusercontent.com"},
},
{
name: "duplicate domains removed",
input: []string{"npm", "npm"},
wantAll: false,
name: "duplicate domains removed",
input: []string{"npm", "npm"},
wantAll: false,
wantBlocked: false,
wantDomains: []string{"registry.npmjs.org", "npmjs.com"},
},
Expand Down
18 changes: 9 additions & 9 deletions internal/vm/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
)

type Config struct {
ProjectDir string
Mounts []session.VMMount
Network []string
NetworkPolicy *network.Policy
CPUs int
Memory string
Timeout time.Duration
ClaudeMode bool
HostClaudeDir string
ProjectDir string
Mounts []session.VMMount
Network []string
NetworkPolicy *network.Policy
CPUs int
Memory string
Timeout time.Duration
ClaudeMode bool
HostClaudeDir string
ToolchainDir string
CredentialsDir string
ExtraDeps []string
Expand Down
Loading