Skip to content

Commit ab46688

Browse files
authored
Merge pull request #27 from codacy/fix-tests
fix: Run all tests
2 parents 1e9a11a + 786b2f9 commit ab46688

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
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

tools/eslintConfigCreator.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ func CreateEslintConfig(configuration ToolConfiguration) string {
3333
rule = strings.ReplaceAll(rule, "_", "/")
3434
rule = strings.ReplaceAll(rule, tempstring, "_")
3535

36-
/*if strings.Contains(rule, "/") {
37-
continue
38-
}*/
39-
4036
parametersString := ""
4137

4238
for _, parameter := range patternConfiguration.ParamenterConfigurations {

tools/eslintConfigCreator_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func TestCreateEslintConfigUnnamedAndNamedParam(t *testing.T) {
116116
];`)
117117
}
118118

119-
func TestCreateEslintConfigSkipPlugins(t *testing.T) {
119+
func TestCreateEslintConfigSupportPlugins(t *testing.T) {
120120
testConfig(t,
121121
ToolConfiguration{
122122
PatternsConfiguration: []PatternConfiguration{
@@ -128,6 +128,7 @@ func TestCreateEslintConfigSkipPlugins(t *testing.T) {
128128
`export default [
129129
{
130130
rules: {
131+
"plugin/consistent-return": "error",
131132
}
132133
}
133134
];`)

0 commit comments

Comments
 (0)