Skip to content

Commit f6873c4

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

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/go.yml

Lines changed: 4 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
@@ -15,9 +15,11 @@ jobs:
1515
uses: actions/setup-go@v4
1616
- name: "Run tests"
1717
run: |
18-
go test
18+
go test ./...
1919
2020
release:
21+
needs: test
22+
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.event_name == 'push'
2123
runs-on: ubuntu-latest
2224
steps:
2325
- 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)