mirror of
https://github.com/lukaszraczylo/kportal.git
synced 2026-07-06 06:16:10 +00:00
style: Extract UI constants and refactor main view rendering (#30)
- [x] Add golangci-lint configuration with gocritic ifElseChain disabled
- [x] Rename error variables to avoid shadowing (createErr, watcherErr, watchErr, etc.)
- [x] Replace `interface{}` with `any` type alias throughout codebase
- [x] Add package-level documentation comments to all internal packages
- [x] Reorder struct fields alphabetically for consistency
- [x] Extract UI constants (terminal dimensions, column widths, colors) to constants.go
- [x] Refactor BubbleTeaUI main view rendering into smaller helper functions
- [x] Simplify nested conditionals and improve code clarity
- [x] Add `isForwardDisabled()` helper method to BubbleTeaUI
- [x] Update file permissions from 0644 to 0600 in config tests
- [x] Add `#nosec` comments and error suppression where appropriate
- [x] Improve test table struct field ordering for readability
- [x] Fix resource parsing in AddForward using strings.SplitN
- [x] Add comprehensive tests for new UI helper functions and constants
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
// Package version provides version checking against GitHub releases.
|
||||
// It queries the GitHub API to check for newer versions of kportal
|
||||
// and provides update notifications.
|
||||
//
|
||||
// Basic usage:
|
||||
//
|
||||
// info, err := version.CheckForUpdate(ctx, "owner", "repo", "v1.0.0")
|
||||
// if err != nil {
|
||||
// log.Printf("Version check failed: %v", err)
|
||||
// } else if info.UpdateAvailable {
|
||||
// fmt.Printf("Update available: %s -> %s\n", info.CurrentVersion, info.LatestVersion)
|
||||
// }
|
||||
package version
|
||||
|
||||
import (
|
||||
@@ -33,10 +45,10 @@ type UpdateInfo struct {
|
||||
|
||||
// Checker checks for new versions on GitHub
|
||||
type Checker struct {
|
||||
client *http.Client
|
||||
owner string
|
||||
repo string
|
||||
current string
|
||||
client *http.Client
|
||||
}
|
||||
|
||||
// NewChecker creates a new version checker
|
||||
|
||||
Reference in New Issue
Block a user