Skip to content

Commit 27155c4

Browse files
committed
style: add missing periods to comments
Fix godot linter warnings by adding periods to comment sentences.
1 parent 70ade3c commit 27155c4

File tree

12 files changed

+116
-111
lines changed

12 files changed

+116
-111
lines changed

borders.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package termhyo
22

3-
// BorderStyle defines different border styles
3+
// BorderStyle defines different border styles.
44
type BorderStyle string
55

6-
// BorderConfig holds border style configuration
6+
// BorderConfig holds border style configuration.
77
type BorderConfig struct {
88
Chars map[string]string
99
Top bool // Show top border
@@ -16,23 +16,23 @@ type BorderConfig struct {
1616
}
1717

1818
const (
19-
// BoxDrawingStyle uses Unicode box drawing characters
19+
// BoxDrawingStyle uses Unicode box drawing characters.
2020
BoxDrawingStyle BorderStyle = "box"
21-
// ASCIIStyle uses ASCII characters
21+
// ASCIIStyle uses ASCII characters.
2222
ASCIIStyle BorderStyle = "ascii"
23-
// RoundedStyle uses rounded corners
23+
// RoundedStyle uses rounded corners.
2424
RoundedStyle BorderStyle = "rounded"
25-
// DoubleStyle uses double line box drawing
25+
// DoubleStyle uses double line box drawing.
2626
DoubleStyle BorderStyle = "double"
27-
// MinimalStyle uses minimal borders
27+
// MinimalStyle uses minimal borders.
2828
MinimalStyle BorderStyle = "minimal"
29-
// MarkdownStyle uses Markdown table format
29+
// MarkdownStyle uses Markdown table format.
3030
MarkdownStyle BorderStyle = "markdown"
31-
// TSVStyle uses tab separators only
31+
// TSVStyle uses tab separators only.
3232
TSVStyle BorderStyle = "tsv"
3333
)
3434

35-
// Predefined border configurations
35+
// Predefined border configurations.
3636
var (
3737
boxDrawingConfig = BorderConfig{
3838
Chars: map[string]string{
@@ -196,7 +196,7 @@ var (
196196
}
197197
)
198198

199-
// getBorderConfig returns border configuration for the specified style
199+
// getBorderConfig returns border configuration for the specified style.
200200
func getBorderConfig(style BorderStyle) BorderConfig {
201201
switch style {
202202
case ASCIIStyle:

column.go

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
package termhyo
22

3-
// Column defines column properties
3+
// Column defines column properties.
44
type Column struct {
5-
Key string
6-
Title string
7-
Width int // 0 means auto-width
8-
MaxWidth int // maximum width for auto-width columns
9-
Align string // "left", "right", "center"
5+
Title string // Column header title
6+
Width int // Column width (0 = auto-width)
7+
MaxWidth int // Maximum width for auto-width columns (0 = no limit)
8+
Align string // Alignment: "left", "center", "right"
109
}
1110

12-
// Cell represents a table cell
11+
// Cell represents a table cell.
1312
type Cell struct {
14-
Content string
15-
Align string // overrides column alignment if set
13+
Content string // Cell content
14+
Align string // Cell-specific alignment override
1615
}
1716

18-
// Row represents a table row
17+
// Row represents a table row.
1918
type Row struct {
20-
Cells []Cell
19+
Cells []Cell // Row cells
2120
}

examples/markdown/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func main() {
1616

1717
// Create table with Markdown style
1818
table := termhyo.NewTableWithStyle(os.Stdout, columns, termhyo.WithBorderStyle(termhyo.MarkdownStyle))
19-
//table.SetAlign(false) // Disable alignment for streaming mode
19+
// table.SetAlign(false) // Disable alignment for streaming mode
2020
// Simulate real-time data streaming in Markdown format
2121
events := [][]string{
2222
{"09:00:00", "System startup", "OK"},
@@ -29,7 +29,7 @@ func main() {
2929
for _, event := range events {
3030
table.AddRow(event...)
3131
// Simulate delay between events
32-
//time.Sleep(500 * time.Millisecond)
32+
// time.Sleep(500 * time.Millisecond)
3333
}
3434

3535
// Complete the table

examples/streaming/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func main() {
1919
table := termhyo.NewTableWithStyle(os.Stdout, columns, termhyo.WithBorderStyle(termhyo.ASCIIStyle))
2020

2121
// Disable alignment for streaming mode using Table-level setting
22-
//table.SetNoAlign(true)
22+
// table.SetAlign(false)
2323

2424
// Simulate real-time data streaming
2525
events := [][]string{

features_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
)
77

8-
// TestIndividualFeatures tests specific features in isolation
8+
// TestIndividualFeatures tests specific features in isolation.
99
func TestIndividualFeatures(t *testing.T) {
1010
t.Run("HeaderStyleApply", func(t *testing.T) {
1111
style := HeaderStyle{
@@ -76,7 +76,7 @@ func TestIndividualFeatures(t *testing.T) {
7676
})
7777
}
7878

79-
// TestConvenienceMethods tests the convenience methods for header styling
79+
// TestConvenienceMethods tests the convenience methods for header styling.
8080
func TestConvenienceMethods(t *testing.T) {
8181
tests := []struct {
8282
name string
@@ -151,7 +151,7 @@ func TestConvenienceMethods(t *testing.T) {
151151
}
152152
}
153153

154-
// TestRenderModes tests different rendering modes
154+
// TestRenderModes tests different rendering modes.
155155
func TestRenderModes(t *testing.T) {
156156
t.Run("BufferedMode", func(t *testing.T) {
157157
var buf bytes.Buffer

header_styles.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"strconv"
66
)
77

8-
// ANSI escape sequences for text formatting
8+
// ANSI escape sequences for text formatting.
99
const (
1010
// Text formatting
1111
AnsiReset = "\x1b[0m"
@@ -58,7 +58,7 @@ const (
5858
AnsiBgBrightWhite = "\x1b[107m"
5959
)
6060

61-
// HeaderStyle defines the styling for table headers
61+
// HeaderStyle defines the styling for table headers.
6262
type HeaderStyle struct {
6363
// Text formatting
6464
Bold bool
@@ -78,37 +78,37 @@ type HeaderStyle struct {
7878
CustomSuffix string // Custom ANSI sequence to append
7979
}
8080

81-
// DefaultHeaderStyle returns a default header style with bold and underline
81+
// DefaultHeaderStyle returns a default header style with bold and underline.
8282
func DefaultHeaderStyle() HeaderStyle {
8383
return HeaderStyle{
8484
Bold: true,
8585
Underline: true,
8686
}
8787
}
8888

89-
// BoldHeaderStyle returns a header style with bold text
89+
// BoldHeaderStyle returns a header style with bold text.
9090
func BoldHeaderStyle() HeaderStyle {
9191
return HeaderStyle{
9292
Bold: true,
9393
}
9494
}
9595

96-
// UnderlineHeaderStyle returns a header style with underlined text
96+
// UnderlineHeaderStyle returns a header style with underlined text.
9797
func UnderlineHeaderStyle() HeaderStyle {
9898
return HeaderStyle{
9999
Underline: true,
100100
}
101101
}
102102

103-
// ColoredHeaderStyle returns a header style with specified colors
103+
// ColoredHeaderStyle returns a header style with specified colors.
104104
func ColoredHeaderStyle(fgColor, bgColor string) HeaderStyle {
105105
return HeaderStyle{
106106
ForegroundColor: fgColor,
107107
BackgroundColor: bgColor,
108108
}
109109
}
110110

111-
// ApplyStyle applies the header style to the given text
111+
// ApplyStyle applies the header style to the given text.
112112
func (hs HeaderStyle) ApplyStyle(text string) string {
113113
if hs.isEmpty() {
114114
return text
@@ -163,7 +163,7 @@ func (hs HeaderStyle) ApplyStyle(text string) string {
163163
return prefix + text + suffix
164164
}
165165

166-
// getPrefix returns the ANSI prefix for the header style
166+
// getPrefix returns the ANSI prefix for the header style.
167167
func (hs HeaderStyle) getPrefix() string {
168168
if hs.isEmpty() {
169169
return ""
@@ -212,7 +212,7 @@ func (hs HeaderStyle) getPrefix() string {
212212
return prefix
213213
}
214214

215-
// getSuffix returns the ANSI suffix for the header style
215+
// getSuffix returns the ANSI suffix for the header style.
216216
func (hs HeaderStyle) getSuffix() string {
217217
if hs.isEmpty() {
218218
return ""
@@ -228,15 +228,15 @@ func (hs HeaderStyle) getSuffix() string {
228228
return suffix
229229
}
230230

231-
// isEmpty checks if the header style has any formatting applied
231+
// isEmpty checks if the header style has any formatting applied.
232232
func (hs HeaderStyle) isEmpty() bool {
233233
return !hs.Bold && !hs.Underline && !hs.Italic && !hs.Dim &&
234234
!hs.Blink && !hs.Reverse && !hs.Strike &&
235235
hs.ForegroundColor == "" && hs.BackgroundColor == "" &&
236236
hs.CustomPrefix == "" && hs.CustomSuffix == ""
237237
}
238238

239-
// Combine combines this header style with another, with the other style taking precedence
239+
// Combine combines this header style with another, with the other style taking precedence.
240240
func (hs HeaderStyle) Combine(other HeaderStyle) HeaderStyle {
241241
result := hs
242242

@@ -282,22 +282,22 @@ func (hs HeaderStyle) Combine(other HeaderStyle) HeaderStyle {
282282
return result
283283
}
284284

285-
// RGB256 returns a 256-color ANSI code for foreground
285+
// RGB256 returns a 256-color ANSI code for foreground.
286286
func RGB256(colorCode int) string {
287287
return "\x1b[38;5;" + strconv.Itoa(colorCode) + "m"
288288
}
289289

290-
// BgRGB256 returns a 256-color ANSI code for background
290+
// BgRGB256 returns a 256-color ANSI code for background.
291291
func BgRGB256(colorCode int) string {
292292
return "\x1b[48;5;" + strconv.Itoa(colorCode) + "m"
293293
}
294294

295-
// TrueColorFg returns a true color (24-bit) ANSI code for foreground
295+
// TrueColorFg returns a true color (24-bit) ANSI code for foreground.
296296
func TrueColorFg(r, g, b int) string {
297297
return fmt.Sprintf("\x1b[38;2;%d;%d;%dm", r, g, b)
298298
}
299299

300-
// TrueColorBg returns a true color (24-bit) ANSI code for background
300+
// TrueColorBg returns a true color (24-bit) ANSI code for background.
301301
func TrueColorBg(r, g, b int) string {
302302
return fmt.Sprintf("\x1b[48;2;%d;%d;%dm", r, g, b)
303303
}

markdown.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import (
55
"strings"
66
)
77

8-
// MarkdownRenderer implements Markdown table format with streaming support
8+
// MarkdownRenderer implements Markdown table format with streaming support.
99
type MarkdownRenderer struct {
1010
rendered bool
1111
bufferedRows []Row // Buffer rows for width calculation
1212
}
1313

14-
// hasAutoWidth checks if any columns have auto width
14+
// hasAutoWidth checks if any columns have auto width.
1515
func hasAutoWidth(table *Table) bool {
1616
if !table.align {
1717
return false // No auto width in streaming mode
@@ -24,8 +24,8 @@ func hasAutoWidth(table *Table) bool {
2424
return false
2525
}
2626

27-
// AddRow adds a row for markdown rendering (buffered mode for width calculation)
28-
func (r *MarkdownRenderer) AddRow(table *Table, row Row) error {
27+
// AddRow adds a row for markdown rendering (buffered mode for width calculation).
28+
func (r *MarkdownRenderer) AddRow(_ *Table, row Row) error {
2929
if r.rendered {
3030
return fmt.Errorf("cannot add rows after table is rendered")
3131
}
@@ -37,7 +37,7 @@ func (r *MarkdownRenderer) AddRow(table *Table, row Row) error {
3737
return nil
3838
}
3939

40-
// Render renders any remaining content (for streaming, this is just cleanup)
40+
// Render renders any remaining content (for streaming, this is just cleanup).
4141
func (r *MarkdownRenderer) Render(table *Table) error {
4242
if r.rendered {
4343
return fmt.Errorf("table already rendered")
@@ -71,12 +71,12 @@ func (r *MarkdownRenderer) Render(table *Table) error {
7171
return nil
7272
}
7373

74-
// IsRendered returns whether the table has been rendered
74+
// IsRendered returns whether the table has been rendered.
7575
func (r *MarkdownRenderer) IsRendered() bool {
7676
return r.rendered
7777
}
7878

79-
// renderMarkdownHeader renders the header row in Markdown format
79+
// renderMarkdownHeader renders the header row in Markdown format.
8080
func (r *MarkdownRenderer) renderMarkdownHeader(table *Table) error {
8181
var line string
8282
var stylePrefix, styleSuffix string
@@ -105,7 +105,7 @@ func (r *MarkdownRenderer) renderMarkdownHeader(table *Table) error {
105105
return err
106106
}
107107

108-
// renderMarkdownSeparator renders the separator row with alignment indicators
108+
// renderMarkdownSeparator renders the separator row with alignment indicators.
109109
func (r *MarkdownRenderer) renderMarkdownSeparator(table *Table) error {
110110
line := "|"
111111

@@ -123,7 +123,7 @@ func (r *MarkdownRenderer) renderMarkdownSeparator(table *Table) error {
123123
return err
124124
}
125125

126-
// renderMarkdownRow renders a data row in Markdown format
126+
// renderMarkdownRow renders a data row in Markdown format.
127127
func (r *MarkdownRenderer) renderMarkdownRow(table *Table, row Row) error {
128128
line := "|"
129129

@@ -158,7 +158,7 @@ func (r *MarkdownRenderer) renderMarkdownRow(table *Table, row Row) error {
158158
return err
159159
}
160160

161-
// getAlignmentSeparator returns the separator string with alignment indicators
161+
// getAlignmentSeparator returns the separator string with alignment indicators.
162162
func (r *MarkdownRenderer) getAlignmentSeparator(align string, width int) string {
163163
switch align {
164164
case "right":

0 commit comments

Comments
 (0)