Skip to content

Commit bee7e9c

Browse files
fix(yaml): add missing yaml tags
resolves #6331
1 parent 831cc2b commit bee7e9c

File tree

7 files changed

+82
-82
lines changed

7 files changed

+82
-82
lines changed

Diff for: src/cache/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package cache
22

33
type Config struct {
4-
Duration Duration `json:"duration,omitempty" toml:"duration,omitempty"`
5-
Strategy Strategy `json:"strategy,omitempty" toml:"strategy,omitempty"`
4+
Duration Duration `json:"duration,omitempty" toml:"duration,omitempty" yaml:"duration,omitempty"`
5+
Strategy Strategy `json:"strategy,omitempty" toml:"strategy,omitempty" yaml:"strategy,omitempty"`
66
}
77

88
type Strategy string

Diff for: src/color/colors.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ type String interface {
2626
}
2727

2828
type Set struct {
29-
Background Ansi `json:"background" toml:"background"`
30-
Foreground Ansi `json:"foreground" toml:"foreground"`
29+
Background Ansi `json:"background" toml:"background" yaml:"background"`
30+
Foreground Ansi `json:"foreground" toml:"foreground" yaml:"foreground"`
3131
}
3232

3333
func (c *Set) String() string {

Diff for: src/color/palettes.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package color
22

33
type Palettes struct {
4-
List map[string]Palette `json:"list,omitempty" toml:"list,omitempty"`
5-
Template string `json:"template,omitempty" toml:"template,omitempty"`
4+
List map[string]Palette `json:"list,omitempty" toml:"list,omitempty" yaml:"list,omitempty"`
5+
Template string `json:"template,omitempty" toml:"template,omitempty" yaml:"template,omitempty"`
66
}

Diff for: src/config/block.go

+11-11
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ const (
2626

2727
// Block defines a part of the prompt with optional segments
2828
type Block struct {
29-
Type BlockType `json:"type,omitempty" toml:"type,omitempty"`
30-
Alignment BlockAlignment `json:"alignment,omitempty" toml:"alignment,omitempty"`
31-
Filler string `json:"filler,omitempty" toml:"filler,omitempty"`
32-
Overflow Overflow `json:"overflow,omitempty" toml:"overflow,omitempty"`
33-
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"`
34-
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"`
35-
Segments []*Segment `json:"segments,omitempty" toml:"segments,omitempty"`
36-
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"`
37-
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"`
38-
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
39-
Force bool `json:"force,omitempty" toml:"force,omitempty"`
29+
Type BlockType `json:"type,omitempty" toml:"type,omitempty" yaml:"type,omitempty"`
30+
Alignment BlockAlignment `json:"alignment,omitempty" toml:"alignment,omitempty" yaml:"alignment,omitempty"`
31+
Filler string `json:"filler,omitempty" toml:"filler,omitempty" yaml:"filler,omitempty"`
32+
Overflow Overflow `json:"overflow,omitempty" toml:"overflow,omitempty" yaml:"overflow,omitempty"`
33+
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty" yaml:"leading_diamond,omitempty"`
34+
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty" yaml:"trailing_diamond,omitempty"`
35+
Segments []*Segment `json:"segments,omitempty" toml:"segments,omitempty" yaml:"segments,omitempty"`
36+
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty" yaml:"max_width,omitempty"`
37+
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty" yaml:"min_width,omitempty"`
38+
Newline bool `json:"newline,omitempty" toml:"newline,omitempty" yaml:"newline,omitempty"`
39+
Force bool `json:"force,omitempty" toml:"force,omitempty" yaml:"force,omitempty"`
4040
}

Diff for: src/config/config.go

+27-27
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,35 @@ const (
2424

2525
// Config holds all the theme for rendering the prompt
2626
type Config struct {
27-
Palette color.Palette `json:"palette,omitempty" toml:"palette,omitempty"`
28-
DebugPrompt *Segment `json:"debug_prompt,omitempty" toml:"debug_prompt,omitempty"`
29-
Var map[string]any `json:"var,omitempty" toml:"var,omitempty"`
30-
Palettes *color.Palettes `json:"palettes,omitempty" toml:"palettes,omitempty"`
31-
ValidLine *Segment `json:"valid_line,omitempty" toml:"valid_line,omitempty"`
32-
SecondaryPrompt *Segment `json:"secondary_prompt,omitempty" toml:"secondary_prompt,omitempty"`
33-
TransientPrompt *Segment `json:"transient_prompt,omitempty" toml:"transient_prompt,omitempty"`
34-
ErrorLine *Segment `json:"error_line,omitempty" toml:"error_line,omitempty"`
35-
TerminalBackground color.Ansi `json:"terminal_background,omitempty" toml:"terminal_background,omitempty"`
27+
Palette color.Palette `json:"palette,omitempty" toml:"palette,omitempty" yaml:"palette,omitempty"`
28+
DebugPrompt *Segment `json:"debug_prompt,omitempty" toml:"debug_prompt,omitempty" yaml:"debug_prompt,omitempty"`
29+
Var map[string]any `json:"var,omitempty" toml:"var,omitempty" yaml:"var,omitempty"`
30+
Palettes *color.Palettes `json:"palettes,omitempty" toml:"palettes,omitempty" yaml:"palettes,omitempty"`
31+
ValidLine *Segment `json:"valid_line,omitempty" toml:"valid_line,omitempty" yaml:"valid_line,omitempty"`
32+
SecondaryPrompt *Segment `json:"secondary_prompt,omitempty" toml:"secondary_prompt,omitempty" yaml:"secondary_prompt,omitempty"`
33+
TransientPrompt *Segment `json:"transient_prompt,omitempty" toml:"transient_prompt,omitempty" yaml:"transient_prompt,omitempty"`
34+
ErrorLine *Segment `json:"error_line,omitempty" toml:"error_line,omitempty" yaml:"error_line,omitempty"`
35+
TerminalBackground color.Ansi `json:"terminal_background,omitempty" toml:"terminal_background,omitempty" yaml:"terminal_background,omitempty"`
3636
origin string
37-
PWD string `json:"pwd,omitempty" toml:"pwd,omitempty"`
38-
AccentColor color.Ansi `json:"accent_color,omitempty" toml:"accent_color,omitempty"`
39-
Output string `json:"-" toml:"-"`
40-
ConsoleTitleTemplate string `json:"console_title_template,omitempty" toml:"console_title_template,omitempty"`
41-
Format string `json:"-" toml:"-"`
42-
Upgrade *upgrade.Config `json:"upgrade,omitempty" toml:"upgrade,omitempty"`
43-
Cycle color.Cycle `json:"cycle,omitempty" toml:"cycle,omitempty"`
44-
ITermFeatures terminal.ITermFeatures `json:"iterm_features,omitempty" toml:"iterm_features,omitempty"`
45-
Blocks []*Block `json:"blocks,omitempty" toml:"blocks,omitempty"`
46-
Tooltips []*Segment `json:"tooltips,omitempty" toml:"tooltips,omitempty"`
47-
Version int `json:"version" toml:"version"`
48-
AutoUpgrade bool `json:"-" toml:"-"`
49-
ShellIntegration bool `json:"shell_integration,omitempty" toml:"shell_integration,omitempty"`
50-
MigrateGlyphs bool `json:"-" toml:"-"`
51-
PatchPwshBleed bool `json:"patch_pwsh_bleed,omitempty" toml:"patch_pwsh_bleed,omitempty"`
52-
EnableCursorPositioning bool `json:"enable_cursor_positioning,omitempty" toml:"enable_cursor_positioning,omitempty"`
37+
PWD string `json:"pwd,omitempty" toml:"pwd,omitempty" yaml:"pwd,omitempty"`
38+
AccentColor color.Ansi `json:"accent_color,omitempty" toml:"accent_color,omitempty" yaml:"accent_color,omitempty"`
39+
Output string `json:"-" toml:"-" yaml:"-"`
40+
ConsoleTitleTemplate string `json:"console_title_template,omitempty" toml:"console_title_template,omitempty" yaml:"console_title_template,omitempty"`
41+
Format string `json:"-" toml:"-" yaml:"-"`
42+
Upgrade *upgrade.Config `json:"upgrade,omitempty" toml:"upgrade,omitempty" yaml:"upgrade,omitempty"`
43+
Cycle color.Cycle `json:"cycle,omitempty" toml:"cycle,omitempty" yaml:"cycle,omitempty"`
44+
ITermFeatures terminal.ITermFeatures `json:"iterm_features,omitempty" toml:"iterm_features,omitempty" yaml:"iterm_features,omitempty"`
45+
Blocks []*Block `json:"blocks,omitempty" toml:"blocks,omitempty" yaml:"blocks,omitempty"`
46+
Tooltips []*Segment `json:"tooltips,omitempty" toml:"tooltips,omitempty" yaml:"tooltips,omitempty"`
47+
Version int `json:"version" toml:"version" yaml:"version"`
48+
AutoUpgrade bool `json:"-" toml:"-" yaml:"-"`
49+
ShellIntegration bool `json:"shell_integration,omitempty" toml:"shell_integration,omitempty" yaml:"shell_integration,omitempty"`
50+
MigrateGlyphs bool `json:"-" toml:"-" yaml:"-"`
51+
PatchPwshBleed bool `json:"patch_pwsh_bleed,omitempty" toml:"patch_pwsh_bleed,omitempty" yaml:"patch_pwsh_bleed,omitempty"`
52+
EnableCursorPositioning bool `json:"enable_cursor_positioning,omitempty" toml:"enable_cursor_positioning,omitempty" yaml:"enable_cursor_positioning,omitempty"`
5353
updated bool
54-
FinalSpace bool `json:"final_space,omitempty" toml:"final_space,omitempty"`
55-
UpgradeNotice bool `json:"-" toml:"-"`
54+
FinalSpace bool `json:"final_space,omitempty" toml:"final_space,omitempty" yaml:"final_space,omitempty"`
55+
UpgradeNotice bool `json:"-" toml:"-" yaml:"-"`
5656
}
5757

5858
func (cfg *Config) MakeColors(env runtime.Environment) color.String {

Diff for: src/config/segment.go

+31-31
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,39 @@ func (s *SegmentStyle) resolve(context any) SegmentStyle {
4141
type Segment struct {
4242
writer SegmentWriter
4343
env runtime.Environment
44-
Properties properties.Map `json:"properties,omitempty" toml:"properties,omitempty"`
45-
Cache *cache.Config `json:"cache,omitempty" toml:"cache,omitempty"`
46-
Alias string `json:"alias,omitempty" toml:"alias,omitempty"`
44+
Properties properties.Map `json:"properties,omitempty" toml:"properties,omitempty" yaml:"properties,omitempty"`
45+
Cache *cache.Config `json:"cache,omitempty" toml:"cache,omitempty" yaml:"cache,omitempty"`
46+
Alias string `json:"alias,omitempty" toml:"alias,omitempty" yaml:"alias,omitempty"`
4747
styleCache SegmentStyle
4848
name string
49-
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty"`
50-
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty"`
51-
Template string `json:"template,omitempty" toml:"template,omitempty"`
52-
Foreground color.Ansi `json:"foreground,omitempty" toml:"foreground,omitempty"`
53-
TemplatesLogic template.Logic `json:"templates_logic,omitempty" toml:"templates_logic,omitempty"`
54-
PowerlineSymbol string `json:"powerline_symbol,omitempty" toml:"powerline_symbol,omitempty"`
55-
Background color.Ansi `json:"background,omitempty" toml:"background,omitempty"`
56-
Filler string `json:"filler,omitempty" toml:"filler,omitempty"`
57-
Type SegmentType `json:"type,omitempty" toml:"type,omitempty"`
58-
Style SegmentStyle `json:"style,omitempty" toml:"style,omitempty"`
59-
LeadingPowerlineSymbol string `json:"leading_powerline_symbol,omitempty" toml:"leading_powerline_symbol,omitempty"`
60-
ForegroundTemplates template.List `json:"foreground_templates,omitempty" toml:"foreground_templates,omitempty"`
61-
Tips []string `json:"tips,omitempty" toml:"tips,omitempty"`
62-
BackgroundTemplates template.List `json:"background_templates,omitempty" toml:"background_templates,omitempty"`
63-
Templates template.List `json:"templates,omitempty" toml:"templates,omitempty"`
64-
ExcludeFolders []string `json:"exclude_folders,omitempty" toml:"exclude_folders,omitempty"`
65-
IncludeFolders []string `json:"include_folders,omitempty" toml:"include_folders,omitempty"`
66-
Needs []string `json:"-" toml:"-"`
67-
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty"`
68-
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty"`
69-
Timeout time.Duration `json:"timeout,omitempty" toml:"timeout,omitempty"`
70-
Duration time.Duration `json:"-" toml:"-"`
71-
NameLength int `json:"-" toml:"-"`
72-
Interactive bool `json:"interactive,omitempty" toml:"interactive,omitempty"`
73-
Enabled bool `json:"-" toml:"-"`
74-
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
75-
InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty"`
76-
restored bool `json:"-" toml:"-"`
49+
LeadingDiamond string `json:"leading_diamond,omitempty" toml:"leading_diamond,omitempty" yaml:"leading_diamond,omitempty"`
50+
TrailingDiamond string `json:"trailing_diamond,omitempty" toml:"trailing_diamond,omitempty" yaml:"trailing_diamond,omitempty"`
51+
Template string `json:"template,omitempty" toml:"template,omitempty" yaml:"template,omitempty"`
52+
Foreground color.Ansi `json:"foreground,omitempty" toml:"foreground,omitempty" yaml:"foreground,omitempty"`
53+
TemplatesLogic template.Logic `json:"templates_logic,omitempty" toml:"templates_logic,omitempty" yaml:"templates_logic,omitempty"`
54+
PowerlineSymbol string `json:"powerline_symbol,omitempty" toml:"powerline_symbol,omitempty" yaml:"powerline_symbol,omitempty"`
55+
Background color.Ansi `json:"background,omitempty" toml:"background,omitempty" yaml:"background,omitempty"`
56+
Filler string `json:"filler,omitempty" toml:"filler,omitempty" yaml:"filler,omitempty"`
57+
Type SegmentType `json:"type,omitempty" toml:"type,omitempty" yaml:"type,omitempty"`
58+
Style SegmentStyle `json:"style,omitempty" toml:"style,omitempty" yaml:"style,omitempty"`
59+
LeadingPowerlineSymbol string `json:"leading_powerline_symbol,omitempty" toml:"leading_powerline_symbol,omitempty" yaml:"leading_powerline_symbol,omitempty"`
60+
ForegroundTemplates template.List `json:"foreground_templates,omitempty" toml:"foreground_templates,omitempty" yaml:"foreground_templates,omitempty"`
61+
Tips []string `json:"tips,omitempty" toml:"tips,omitempty" yaml:"tips,omitempty"`
62+
BackgroundTemplates template.List `json:"background_templates,omitempty" toml:"background_templates,omitempty" yaml:"background_templates,omitempty"`
63+
Templates template.List `json:"templates,omitempty" toml:"templates,omitempty" yaml:"templates,omitempty"`
64+
ExcludeFolders []string `json:"exclude_folders,omitempty" toml:"exclude_folders,omitempty" yaml:"exclude_folders,omitempty"`
65+
IncludeFolders []string `json:"include_folders,omitempty" toml:"include_folders,omitempty" yaml:"include_folders,omitempty"`
66+
Needs []string `json:"-" toml:"-" yaml:"-"`
67+
MinWidth int `json:"min_width,omitempty" toml:"min_width,omitempty" yaml:"min_width,omitempty"`
68+
MaxWidth int `json:"max_width,omitempty" toml:"max_width,omitempty" yaml:"max_width,omitempty"`
69+
Timeout time.Duration `json:"timeout,omitempty" toml:"timeout,omitempty" yaml:"timeout,omitempty"`
70+
Duration time.Duration `json:"-" toml:"-" yaml:"-"`
71+
NameLength int `json:"-" toml:"-" yaml:"-"`
72+
Interactive bool `json:"interactive,omitempty" toml:"interactive,omitempty" yaml:"interactive,omitempty"`
73+
Enabled bool `json:"-" toml:"-" yaml:"-"`
74+
Newline bool `json:"newline,omitempty" toml:"newline,omitempty" yaml:"newline,omitempty"`
75+
InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty" yaml:"invert_powerline,omitempty"`
76+
restored bool `json:"-" toml:"-" yaml:"-"`
7777
}
7878

7979
func (segment *Segment) Name() string {

Diff for: src/upgrade/config.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import (
1313
)
1414

1515
type Config struct {
16-
Cache cache.Cache `json:"-" toml:"-"`
17-
Source Source `json:"source" toml:"source"`
18-
Interval cache.Duration `json:"interval" toml:"interval"`
19-
Version string `json:"-" toml:"-"`
20-
Auto bool `json:"auto" toml:"auto"`
21-
DisplayNotice bool `json:"notice" toml:"notice"`
22-
Force bool `json:"-" toml:"-"`
16+
Cache cache.Cache `json:"-" toml:"-" yaml:"-"`
17+
Source Source `json:"source" toml:"source" yaml:"source"`
18+
Interval cache.Duration `json:"interval" toml:"interval" yaml:"interval"`
19+
Version string `json:"-" toml:"-" yaml:"-"`
20+
Auto bool `json:"auto" toml:"auto" yaml:"auto"`
21+
DisplayNotice bool `json:"notice" toml:"notice" yaml:"notice"`
22+
Force bool `json:"-" toml:"-" yaml:"-"`
2323
}
2424

2525
type Source string

0 commit comments

Comments
 (0)