Skip to content

Commit 24f1b19

Browse files
committed
fix: Run tests correctly and for all branches
Releases still only happen in the default branch
1 parent 1e9a11a commit 24f1b19

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

.codacy/codacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
runtimes:
22
33
tools:
4-
- eslint@8.57.0
4+
- eslint@9.3.0

.github/workflows/go.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
push:
3-
branches: [main]
3+
branches: ['*']
44

55
permissions:
66
contents: write
@@ -13,11 +13,17 @@ jobs:
1313
uses: actions/checkout@v4
1414
- name: Set up Go
1515
uses: actions/setup-go@v4
16+
- name: Install dependencies from .codacy/codacy.yaml
17+
run: |
18+
go build ./cli-v2.go
19+
./cli-v2 install
1620
- name: "Run tests"
1721
run: |
18-
go test
22+
go test ./...
1923
2024
release:
25+
needs: test
26+
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.event_name == 'push'
2127
runs-on: ubuntu-latest
2228
steps:
2329
- name: Checkout

CLAUDE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CLAUDE.md - Development Guidelines for codacy-cli-v2
2+
3+
## Build & Test Commands
4+
- Build: `go build ./cli-v2.go`
5+
- Run all tests: `go test ./...`
6+
- Run specific test: `go test -run TestName ./package/path`
7+
- Example: `go test -run TestGetTools ./tools`
8+
- Format code: `go fmt ./...`
9+
- Lint: `golint ./...` (if installed)
10+
11+
## Code Style Guidelines
12+
- **Imports**: Standard lib first, external packages second, internal last
13+
- **Naming**: PascalCase for exported (public), camelCase for unexported (private)
14+
- **Error handling**: Return errors as last value, check with `if err != nil`
15+
- **Testing**: Use testify/assert package for assertions
16+
- **Package organization**: Keep related functionality in dedicated packages
17+
- **Documentation**: Document all exported functions, types, and packages
18+
- **Commit messages**: Start with verb, be concise and descriptive
19+
20+
## Project Structure
21+
- `cmd/`: CLI command implementations
22+
- `config/`: Configuration handling
23+
- `tools/`: Tool-specific implementations
24+
- `utils/`: Utility functions

0 commit comments

Comments
 (0)