cli + tui to publish to leaflet (wip) & manage tasks, notes & watch/read lists ๐Ÿƒ
charm leaflet readability golang

build: update module path & add testing action

+106 -17
+61
.github/workflows/test.yml
···
··· 1 + name: Test and Coverage 2 + 3 + on: 4 + push: 5 + branches: [ main, master ] 6 + pull_request: 7 + branches: [ main, master ] 8 + 9 + jobs: 10 + test: 11 + runs-on: ubuntu-latest 12 + 13 + strategy: 14 + matrix: 15 + go-version: [1.24.x] 16 + 17 + steps: 18 + - uses: actions/checkout@v4 19 + 20 + - name: Set up Go 21 + uses: actions/setup-go@v5 22 + with: 23 + go-version: ${{ matrix.go-version }} 24 + 25 + - name: Cache Go modules 26 + uses: actions/cache@v4 27 + with: 28 + path: | 29 + ~/.cache/go-build 30 + ~/go/pkg/mod 31 + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 32 + restore-keys: | 33 + ${{ runner.os }}-go- 34 + 35 + - name: Download dependencies 36 + run: go mod download 37 + 38 + - name: Verify dependencies 39 + run: go mod verify 40 + 41 + - name: Run tests 42 + run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./... 43 + 44 + - name: Generate coverage report 45 + run: go tool cover -html=coverage.out -o coverage.html 46 + 47 + - name: Upload coverage reports to Codecov 48 + uses: codecov/codecov-action@v4 49 + with: 50 + file: ./coverage.out 51 + flags: unittests 52 + name: codecov-umbrella 53 + fail_ci_if_error: false 54 + 55 + - name: Upload coverage artifact 56 + uses: actions/upload-artifact@v4 57 + with: 58 + name: coverage-report 59 + path: | 60 + coverage.out 61 + coverage.html
+5
README.md
··· 1 # Noteleaf 2 3 ```sh 4 ,, ,... 5 `7MN. `7MF' mm `7MM .d' ""
··· 1 # Noteleaf 2 3 + [![codecov](https://codecov.io/gh/stormlightlabs/noteleaf/branch/main/graph/badge.svg)](https://codecov.io/gh/stormlightlabs/noteleaf) 4 + [![Go Report Card](https://goreportcard.com/badge/github.com/stormlightlabs/noteleaf)](https://goreportcard.com/report/github.com/stormlightlabs/noteleaf) 5 + [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) 6 + [![Go Version](https://img.shields.io/github/go-mod/go-version/stormlightlabs/noteleaf)](go.mod) 7 + 8 ```sh 9 ,, ,... 10 `7MN. `7MF' mm `7MM .d' ""
+4 -4
cmd/cli/main.go
··· 8 9 "github.com/charmbracelet/fang" 10 "github.com/spf13/cobra" 11 - "stormlightlabs.org/noteleaf/cmd/handlers" 12 - "stormlightlabs.org/noteleaf/internal/store" 13 - "stormlightlabs.org/noteleaf/internal/ui" 14 - "stormlightlabs.org/noteleaf/internal/utils" 15 ) 16 17 // App represents the main CLI application
··· 8 9 "github.com/charmbracelet/fang" 10 "github.com/spf13/cobra" 11 + "github.com/stormlightlabs/noteleaf/cmd/handlers" 12 + "github.com/stormlightlabs/noteleaf/internal/store" 13 + "github.com/stormlightlabs/noteleaf/internal/ui" 14 + "github.com/stormlightlabs/noteleaf/internal/utils" 15 ) 16 17 // App represents the main CLI application
+2 -2
cmd/handlers/handlers.go
··· 6 "os" 7 "path/filepath" 8 9 - "stormlightlabs.org/noteleaf/internal/store" 10 - "stormlightlabs.org/noteleaf/internal/utils" 11 ) 12 13 // Setup initializes the application database and configuration
··· 6 "os" 7 "path/filepath" 8 9 + "github.com/stormlightlabs/noteleaf/internal/store" 10 + "github.com/stormlightlabs/noteleaf/internal/utils" 11 ) 12 13 // Setup initializes the application database and configuration
+1 -1
cmd/handlers/handlers_test.go
··· 7 "testing" 8 "time" 9 10 - "stormlightlabs.org/noteleaf/internal/store" 11 ) 12 13 func createTestDir(t *testing.T) string {
··· 7 "testing" 8 "time" 9 10 + "github.com/stormlightlabs/noteleaf/internal/store" 11 ) 12 13 func createTestDir(t *testing.T) string {
+23
codecov.yml
···
··· 1 + coverage: 2 + status: 3 + project: 4 + default: 5 + target: auto 6 + threshold: 1% 7 + informational: true 8 + patch: 9 + default: 10 + target: auto 11 + threshold: 1% 12 + informational: true 13 + 14 + comment: 15 + layout: "reach,diff,flags,tree" 16 + behavior: default 17 + require_changes: false 18 + 19 + ignore: 20 + - "**/*_test.go" 21 + - "**/testdata/**" 22 + - "**/vendor/**" 23 + - "cmd/cli/main.go" # Main entry point typically has minimal logic to test
+1 -1
go.mod
··· 1 - module stormlightlabs.org/noteleaf 2 3 go 1.24.5 4
··· 1 + module github.com/stormlightlabs/noteleaf 2 3 go 1.24.5 4
+1 -1
internal/repo/book_repository.go
··· 7 "strings" 8 "time" 9 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 // BookRepository provides database operations for books
··· 7 "strings" 8 "time" 9 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 // BookRepository provides database operations for books
+1 -1
internal/repo/book_repository_test.go
··· 7 "time" 8 9 _ "github.com/mattn/go-sqlite3" 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 func createBookTestDB(t *testing.T) *sql.DB {
··· 7 "time" 8 9 _ "github.com/mattn/go-sqlite3" 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 func createBookTestDB(t *testing.T) *sql.DB {
+1 -1
internal/repo/movie_repository.go
··· 7 "strings" 8 "time" 9 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 // MovieRepository provides database operations for movies
··· 7 "strings" 8 "time" 9 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 // MovieRepository provides database operations for movies
+1 -1
internal/repo/movie_repository_test.go
··· 7 "time" 8 9 _ "github.com/mattn/go-sqlite3" 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 func createMovieTestDB(t *testing.T) *sql.DB {
··· 7 "time" 8 9 _ "github.com/mattn/go-sqlite3" 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 func createMovieTestDB(t *testing.T) *sql.DB {
+1 -1
internal/repo/repositories_test.go
··· 7 8 "github.com/google/uuid" 9 _ "github.com/mattn/go-sqlite3" 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 func createFullTestDB(t *testing.T) *sql.DB {
··· 7 8 "github.com/google/uuid" 9 _ "github.com/mattn/go-sqlite3" 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 func createFullTestDB(t *testing.T) *sql.DB {
+1 -1
internal/repo/task_repository.go
··· 7 "strings" 8 "time" 9 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 // TaskRepository provides database operations for tasks
··· 7 "strings" 8 "time" 9 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 // TaskRepository provides database operations for tasks
+1 -1
internal/repo/task_repository_test.go
··· 8 9 "github.com/google/uuid" 10 _ "github.com/mattn/go-sqlite3" 11 - "stormlightlabs.org/noteleaf/internal/models" 12 ) 13 14 func createTaskTestDB(t *testing.T) *sql.DB {
··· 8 9 "github.com/google/uuid" 10 _ "github.com/mattn/go-sqlite3" 11 + "github.com/stormlightlabs/noteleaf/internal/models" 12 ) 13 14 func createTaskTestDB(t *testing.T) *sql.DB {
+1 -1
internal/repo/tv_repository.go
··· 7 "strings" 8 "time" 9 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 // TVRepository provides database operations for TV shows
··· 7 "strings" 8 "time" 9 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 // TVRepository provides database operations for TV shows
+1 -1
internal/repo/tv_repository_test.go
··· 7 "time" 8 9 _ "github.com/mattn/go-sqlite3" 10 - "stormlightlabs.org/noteleaf/internal/models" 11 ) 12 13 func createTVTestDB(t *testing.T) *sql.DB {
··· 7 "time" 8 9 _ "github.com/mattn/go-sqlite3" 10 + "github.com/stormlightlabs/noteleaf/internal/models" 11 ) 12 13 func createTVTestDB(t *testing.T) *sql.DB {