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