feat: Spring Boot config files in repos (#79)

Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #79.
This commit is contained in:
keb authored and Karl-Einar Bergstrøm committed 2026-10-15 13:11:02 +02:00
1 parent 39cbac9aab
commit 96395cb6a2
15 files changed
+733 -18

No files matched your search

+7 -4
View File
@@ -101,11 +101,14 @@ func (m Model) containerRender(withSource bool) func(styles.Styles, provider.Con
n := st.Node(storeKey(c))
line := c.Name
if c.Source.Kind == provider.KindRepo {
// A secret file: a lock for an encrypted one, a file in the
// warning colour for plain text, and its type after it
// ("sops · age", "env · plain text").
// A secret file: a lock for an encrypted one, a leaf
// for Spring config, a file in the warning colour for plain
// text, and its type after it ("sops · age", "env · plain text").
icon, style := iconSet.Encrypted, sty.KindRepo
if !strings.HasPrefix(c.Detail, "sops") {
switch {
case strings.HasPrefix(c.Detail, "spring"):
icon, style = iconSet.Spring, sty.Spring
case !strings.HasPrefix(c.Detail, "sops"):
icon, style = iconSet.PlainFile, sty.Warning
}
if icon != "" {
+2
View File
@@ -11,6 +11,7 @@ type Set struct {
Repo string
Encrypted string // an encrypted file (SOPS)
PlainFile string // a plain text secrets file (.env)
Spring string // a Spring Boot config file
Note string // has a note (lazysecrets list)
}
@@ -25,6 +26,7 @@ var NerdFont = Set{
Repo: "\U000F02A2", // md-git
Encrypted: "\U000F033E", // md-lock
PlainFile: "\U000F0214", // md-file
Spring: "\U000F032A", // md-leaf
Note: "\U000F09ED",
}
+2
View File
@@ -34,6 +34,7 @@ type Styles struct {
KindAzure lipgloss.Style
KindDatabricks lipgloss.Style
KindRepo lipgloss.Style
Spring lipgloss.Style // Spring Boot config files
// themed marks the selection colours as set by the theme, so
// OnBackground leaves them.
@@ -70,6 +71,7 @@ func Default() Styles {
KindAzure: lipgloss.NewStyle().Foreground(lipgloss.Blue),
KindDatabricks: lipgloss.NewStyle().Foreground(lipgloss.Red),
KindRepo: lipgloss.NewStyle().Foreground(lipgloss.Magenta),
Spring: lipgloss.NewStyle().Foreground(lipgloss.Green),
}
}
+3
View File
@@ -42,6 +42,7 @@ var Roles = map[string]string{
"azureColor": "Azure sources and vaults",
"databricksColor": "Databricks workspaces and scopes",
"repoColor": "repos and their secret files (SOPS)",
"springColor": "Spring Boot config files",
}
// FromTheme returns the default styles with the theme's roles applied, and
@@ -99,6 +100,8 @@ func FromTheme(theme map[string][]string) (Styles, color.Color, error) {
st.KindDatabricks = v.fg(lipgloss.NewStyle())
case "repoColor":
st.KindRepo = v.fg(lipgloss.NewStyle())
case "springColor":
st.Spring = v.fg(lipgloss.NewStyle())
}
}
return st, fg, nil