Skip to content
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
24 changes: 24 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1
10 changes: 10 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "2"

run:
tests: false

linters:
default: standard
exclusions:
paths:
- '(^|/)examples(/|$)'
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Added
- Golang CI lint config and workflow

## [v1.8.2] - 2025-09-20
### Updated
- Expose Option for use in the sub S3 extension
Expand Down
2 changes: 1 addition & 1 deletion examples/intermediate/01-keyboard-controls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/Digital-Shane/treeview"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbletea"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/intermediate/02-search/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/Digital-Shane/treeview"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbletea"
)

// Product represents a product with additional searchable data
Expand Down
2 changes: 1 addition & 1 deletion examples/intermediate/03-viewport/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"log"

"github.com/Digital-Shane/treeview"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbletea"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/intermediate/04-file-browser/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/Digital-Shane/treeview"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)

Expand Down
14 changes: 7 additions & 7 deletions tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbletea"
)

// TuiTreeModelOption represents a functional Option that configures a TuiTreeModel instance directly.
Expand Down Expand Up @@ -224,7 +224,7 @@ func (m *TuiTreeModel[T]) handleKeypress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
case slices.Contains(m.keyMap.SearchDelete, key):
if len(m.searchTerm) > 0 {
m.searchTerm = m.searchTerm[:len(m.searchTerm)-1]
m.Search(m.searchTerm)
_, _ = m.Search(m.searchTerm)
}
return m, nil

Expand All @@ -236,7 +236,7 @@ func (m *TuiTreeModel[T]) handleKeypress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
// Add printable characters to search
if len(key) == 1 && key >= " " && key <= "~" {
m.searchTerm += key
m.Search(m.searchTerm)
_, _ = m.Search(m.searchTerm)
return m, nil
}
}
Expand Down Expand Up @@ -270,7 +270,7 @@ func (m *TuiTreeModel[T]) handleKeypress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.BeginSearch()
return m, nil
case slices.Contains(m.keyMap.Reset, key):
m.ShowAll(context.Background())
_ = m.ShowAll(context.Background())
return m, nil
}

Expand Down Expand Up @@ -463,7 +463,7 @@ func (m *TuiTreeModel[T]) updateViewportDimensions() {
m.viewport.Height = viewHeight

// Update tree truncation width to match viewport width
m.Tree.mu.Lock()
m.Tree.truncateWidth = m.width
m.Tree.mu.Unlock()
m.mu.Lock()
m.truncateWidth = m.width
m.mu.Unlock()
}
2 changes: 1 addition & 1 deletion tui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/bubbletea"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
)
Expand Down