Skip to content
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

Fix/rename-modules-and-fix-tests #1

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .github/workflows/gofmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ name: Gofmt on Push
run-name: Run Gofmt

on:
push:
branches:
- main # Adjust to your branch name if necessary
push:
branches:
- main # Adjust to your branch name if necessary

jobs:
build:
runs-on: ubuntu-latest
build:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v4
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Run gofmt
run: gofmt -w .
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22

- name: Run gofmt
run: gofmt -w .
34 changes: 17 additions & 17 deletions .github/workflows/goruntest.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Go Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
push:
branches: [main]
pull_request:
branches:
- "*"

jobs:
build:
name: Run Go Tests
runs-on: ubuntu-latest
build:
name: Run Go Tests
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v3
steps:
- name: Set up Go
uses: actions/setup-go@v3

- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Get dependencies
run: go mod download

- name: Run tests
run: go test ./... -v
- name: Get dependencies
run: go mod download

- name: Run todo tests
run: go test todo/...
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module toolbox

go 1.20
5 changes: 3 additions & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f h1:MvTmaQdww/z0Q4wrYjDSCcZ78NoftLQyHBSLW/Cx79Y=
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/toolbox/todo"
import "todo"

func main() {
todo.App()
Expand Down
2 changes: 1 addition & 1 deletion navigator/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/toolbox/navigator
module toolbox/navigator

go 1.21
3 changes: 2 additions & 1 deletion todo/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"fmt"
"os"

"todo/model"

tea "github.com/charmbracelet/bubbletea"
"github.com/toolbox/todo/model"
)

func App() {
Expand Down
2 changes: 1 addition & 1 deletion todo/constants/keymap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package constants_test

import (
"testing"
"todo/constants"

"github.com/charmbracelet/bubbles/key"
"github.com/toolbox/todo/constants"
)

// Checks if disable nav does, indeed, disable nav.
Expand Down
7 changes: 5 additions & 2 deletions todo/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/toolbox/todo
module todo

go 1.21

Expand All @@ -7,7 +7,10 @@ require (
github.com/charmbracelet/lipgloss v0.9.1
)

require github.com/google/uuid v1.6.0 // indirect
require (
github.com/atotto/clipboard v0.1.4 // indirect
github.com/google/uuid v1.6.0
)

require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
Expand Down
1 change: 1 addition & 0 deletions todo/go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/charmbracelet/bubbles v0.17.1 h1:0SIyjOnkrsfDo88YvPgAWvZMwXe26TP6drRvmkjyUu4=
Expand Down
5 changes: 2 additions & 3 deletions todo/model/update.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package model

import (
"todo/constants"

"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/google/uuid"
"github.com/toolbox/todo/constants"
)

// Update function.
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd



switch msg := msg.(type) {
case tea.WindowSizeMsg:
// If a width is set to the help menu, this will enable it to
Expand Down
5 changes: 3 additions & 2 deletions todo/model/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"fmt"
"strings"

"todo/constants"

"github.com/charmbracelet/lipgloss"
"github.com/toolbox/todo/constants"
)

// View function.
Expand Down Expand Up @@ -96,7 +97,7 @@ func (m Model) checkDetails(b *strings.Builder) {
// writeDetail renders the info of the current task, as well as the description input.
func (m Model) writeDetail(b *strings.Builder) {
m.checkDetails(b)

// Add the description text area view.
fmt.Fprintf(b, "\n\n%s\n", m.DescriptionInput.View())
}
Loading