Skip to content

Feature/new core #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7c9cb74
Add find command
jm9e May 8, 2025
8dcda8c
Apply changes before refactoring
jm9e May 8, 2025
ff19017
Implement first version of new core
jm9e May 8, 2025
793014f
Extend new pkg
jm9e May 8, 2025
0d2846b
Reorganize loader
jm9e May 8, 2025
3c16924
Fix pkg, extend implementation
jm9e May 8, 2025
3b2b234
Add integration tests
jm9e May 8, 2025
8025e01
Add tests
jm9e May 8, 2025
56c2788
Fix test
jm9e May 8, 2025
71ed09e
Add tests
jm9e May 8, 2025
92621ee
Fix tests
jm9e May 8, 2025
f9e71cc
Add service layer, remove pkgold
jm9e May 8, 2025
59d8939
Fix linting and security issues
jm9e May 8, 2025
3b398b3
Fix go version in pipeline
jm9e May 8, 2025
2a5bf0e
Start implementing cross-module approach
jm9e May 8, 2025
66f9c6f
Extend dependency manager, remove old commands
jm9e May 8, 2025
59502f2
Add toolchain abstraction
jm9e May 8, 2025
49f123c
Complete dependency management with middleware architecture
jm9e May 9, 2025
56e739f
Fix test
jm9e May 9, 2025
e4d0210
Add tests
jm9e May 9, 2025
8537c24
Reorganize
jm9e May 9, 2025
2a8d00b
Fix test
jm9e May 9, 2025
e7b283d
Add README
jm9e May 9, 2025
9002286
Extend executor
jm9e May 9, 2025
bb826e9
Update execute package
jm9e May 10, 2025
42be0c0
Fix tests
jm9e May 10, 2025
78991c4
Fix function tests
jm9e May 10, 2025
1056ef6
Move testing functionality to own package
jm9e May 10, 2025
866cb91
Reorganize
jm9e May 10, 2025
be1a6cc
Move common package
jm9e May 10, 2025
3b9ff4d
Extend run package
jm9e May 10, 2025
d4b2c38
Add testdata file
jm9e May 10, 2025
7950110
Continue refactoring
jm9e May 10, 2025
4c124ba
Fix all tests
jm9e May 10, 2025
edadad6
Add test runner command
jm9e May 10, 2025
470c7ab
Add --sandboxed flag
jm9e May 10, 2025
d40e25c
Add dev package
jm9e May 11, 2025
fab7a6d
Add model and generate packages for Go code representation
jm9e May 11, 2025
9222221
Implement go type bridge
jm9e May 12, 2025
434bce2
Finish implementing basic dev package
jm9e May 12, 2025
47c6ae9
Refactor type difference detection to improve sorting and logic
jm9e May 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/dev-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
run-shared-checks:
uses: ./.github/workflows/shared-go-checks.yml
with:
go-version: '1.21'
go-version: '1.23.1'
run-race-detector: true
run-coverage: true
upload-coverage: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/feature-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
run-shared-checks:
uses: ./.github/workflows/shared-go-checks.yml
with:
go-version: '1.21'
go-version: '1.23.1'
run-race-detector: false
run-coverage: false
upload-coverage: false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
run-shared-checks:
uses: ./.github/workflows/shared-go-checks.yml
with:
go-version: '1.21'
go-version: '1.23.1'
run-race-detector: true
run-coverage: true
upload-coverage: true
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.23.1'
cache: true

- name: Build
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: '1.23.1'
cache: true

- name: Generate docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
run-shared-checks:
uses: ./.github/workflows/shared-go-checks.yml
with:
go-version: '1.21'
go-version: '1.23.1'
run-race-detector: true
run-coverage: true
upload-coverage: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/shared-go-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
go-version:
required: false
type: string
default: '1.21'
default: '1.23.1'
run-race-detector:
required: false
type: boolean
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:

- name: Basic format check
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/goimports@v0.17.0
goimports -l . | tee goimports.out
if [ -s goimports.out ]; then
echo "Code format issues found"
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:

- name: Run govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
go install golang.org/x/vuln/cmd/govulncheck@v1.0.1
govulncheck ./...

- name: Run trivy for filesystem scanning
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ tmp/

# Testing and coverage
*.out
coverage
coverage.html
build-errors.log

# E2E test outputs
/pkg/visual/e2e/testdata/outputs/
/pkgold/visual/e2e/testdata/outputs/
*.current

# IDE/editor specific files
Expand Down
61 changes: 11 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
- Generate JSON representations fully capturing the codebase
- Configurable and available as CLI and Go library

## Architecture

### Low-level reading and writing

### Basic reading and writing

| **Level** | **Reading** | **Writing** |
|--------------|-------------|-------------|
| Cross-module | Resolve | Materialize |
| Module | Loader | Saver |

## Installation

```bash
Expand All @@ -29,56 +40,6 @@ go get bitspark.dev/go-tree
go install bitspark.dev/go-tree/cmd/gotree@latest
```

## Library Usage

```go
package main

import (
"fmt"
"bitspark.dev/go-tree/tree"
)

func main() {
// Parse a Go package
pkg, err := tree.Parse("./path/to/package")
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}

// Get package info
fmt.Printf("Package: %s\n", pkg.Name())
fmt.Printf("Functions: %v\n", pkg.FunctionNames())
fmt.Printf("Types: %v\n", pkg.TypeNames())

// Format package to a single file
output, err := pkg.Format()
if err != nil {
fmt.Printf("Error: %v\n", err)
return
}

fmt.Println(output)
}
```

## CLI Usage

```bash
# Parse a package and output to stdout
gotree -src ./path/to/package

# Parse and save to file with options
gotree -src ./path/to/package -out-file output.go -include-tests -preserve-formatting

# Generate JSON documentation
gotree -src ./path/to/package -json -out-dir ./docs/json

# Process multiple packages in batch mode
gotree -batch "/path/to/pkg1,/path/to/pkg2" -json -out-dir ./docs/json
```

## License

MIT
Loading
Loading