Skip to content

Commit 7cfc1c7

Browse files
authored
Add PR check workflow (#2)
1 parent 8d69816 commit 7cfc1c7

4 files changed

Lines changed: 44 additions & 6 deletions

File tree

.github/workflows/pr.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: pr
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
check:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check out repository
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: go.mod
18+
19+
- name: Check formatting
20+
run: |
21+
diff=$(gofmt -l .)
22+
if [ -n "$diff" ]; then
23+
echo "Files not formatted:"
24+
echo "$diff"
25+
exit 1
26+
fi
27+
28+
- name: Run tests
29+
run: go test ./...

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ jobs:
2828
with:
2929
go-version-file: go.mod
3030

31+
- name: Check formatting
32+
run: |
33+
diff=$(gofmt -l .)
34+
if [ -n "$diff" ]; then
35+
echo "Files not formatted:"
36+
echo "$diff"
37+
exit 1
38+
fi
39+
3140
- name: Run Go tests
3241
run: go test ./...
3342

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ Before opening a PR:
4242
2. Update documentation when behavior changes.
4343
3. Add or update tests when needed.
4444

45-
Recommended checks:
45+
You need to check that your code is properly formatted, tested, and builds successfully.
4646

4747
```bash
48+
gofmt -l .
4849
go test ./...
4950
go build -o ./bin/lazyagent ./cmd/lazyagent
5051
```

internal/tui/styles.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ var (
2121
activePane = lipgloss.NewStyle().Border(lipgloss.NormalBorder()).BorderForeground(colorCyan).Padding(0, 1)
2222
inactivePane = lipgloss.NewStyle().Border(lipgloss.NormalBorder()).BorderForeground(colorGray).Padding(0, 1)
2323

24-
titleStyle = lipgloss.NewStyle().Bold(true).Foreground(colorWhite)
25-
subtitleStyle = lipgloss.NewStyle().Foreground(colorGray)
24+
titleStyle = lipgloss.NewStyle().Bold(true).Foreground(colorWhite)
25+
subtitleStyle = lipgloss.NewStyle().Foreground(colorGray)
2626
selectedStyle = lipgloss.NewStyle().Bold(true).Foreground(colorGreen)
2727
cursorStyle = lipgloss.NewStyle().Bold(true).Background(lipgloss.Color("25")).Foreground(colorWhite)
2828
cursorSelectedStyle = lipgloss.NewStyle().Bold(true).Background(lipgloss.Color("25")).Foreground(colorGreen)
29-
dimStyle = lipgloss.NewStyle().Foreground(colorGray)
30-
statusBarStyle = lipgloss.NewStyle().Foreground(colorDimWhite)
29+
dimStyle = lipgloss.NewStyle().Foreground(colorGray)
30+
statusBarStyle = lipgloss.NewStyle().Foreground(colorDimWhite)
3131

3232
agentColors = []color.Color{
3333
colorCyan, colorMagenta, colorYellow, colorGreen, colorBlue, colorOrange,
@@ -65,7 +65,6 @@ func subtypeColor(subtype string) color.Color {
6565
}
6666
}
6767

68-
6968
func agentColor(index int) color.Color {
7069
if index < 0 {
7170
index = 0

0 commit comments

Comments
 (0)