Skip to content

Commit ae0937c

Browse files
committed
docs: check vlib/time too in the report-missing-dots-in-doc-comments job
1 parent 8578fd4 commit ae0937c

9 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎.github/workflows/docs_ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ jobs:
6969
vlib/builtin/ vlib/arrays/ vlib/flag/ \
7070
vlib/bitfield/ vlib/term/ vlib/strings/ \
7171
vlib/rand/ vlib/compress/ vlib/clipboard/ \
72+
vlib/time/ \
7273
vlib/os

‎vlib/time/chrono.c.v‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
module time
22

3-
// portable_timegm does the same as C._mkgmtime, but unlike it,
4-
// can work with dates before the Unix epoch of 1970-01-01 .
3+
// portable_timegm does the same as C._mkgmtime, but unlike it, can work with dates before the Unix epoch of 1970-01-01 .
54
pub fn portable_timegm(t &C.tm) i64 {
65
mut year := t.tm_year + 1900
76
mut month := t.tm_mon // 0-11

‎vlib/time/duration.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn (d Duration) str() string {
9191
}
9292
}
9393

94-
// debug returns a detailed breakdown of the Duration, as: 'Duration: - 50days, 4h, 3m, 7s, 541ms, 78us, 9ns'
94+
// debug returns a detailed breakdown of the Duration, as: 'Duration: - 50days, 4h, 3m, 7s, 541ms, 78us, 9ns'.
9595
pub fn (d Duration) debug() string {
9696
mut res := []string{}
9797
mut x := i64(d)

‎vlib/time/format.v‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,8 @@ pub fn (t Time) custom_format(s string) string {
562562
return sb.str()
563563
}
564564

565-
// clean returns a date string in a following format:
565+
// clean returns a date string in a clean form.
566+
// It has the following format:
566567
// - a date string in "HH:mm" format (24h) for current day
567568
// - a date string in "MMM D HH:mm" format (24h) for date of current year
568569
// - a date string formatted with format function for other dates
@@ -579,7 +580,8 @@ pub fn (t Time) clean() string {
579580
return t.format()
580581
}
581582

582-
// clean12 returns a date string in a following format:
583+
// clean12 returns a date string in a clean form.
584+
// It has the following format:
583585
// - a date string in "hh:mm" format (12h) for current day
584586
// - a date string in "MMM D hh:mm" format (12h) for date of current year
585587
// - a date string formatted with format function for other dates
@@ -653,8 +655,7 @@ pub fn (t Time) get_fmt_date_str(fmt_dlmtr FormatDelimiter, fmt_date FormatDate)
653655
return res
654656
}
655657

656-
// get_fmt_str returns a date string with specified FormatDelimiter,
657-
// FormatTime type, and FormatDate type.
658+
// get_fmt_str returns a date string with specified FormatDelimiter, FormatTime type, and FormatDate type.
658659
pub fn (t Time) get_fmt_str(fmt_dlmtr FormatDelimiter, fmt_time FormatTime, fmt_date FormatDate) string {
659660
if fmt_date == .no_date {
660661
if fmt_time == .no_time {

‎vlib/time/stopwatch.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn (mut t StopWatch) pause() {
6161
t.start = 0
6262
}
6363

64-
// elapsed returns the Duration since the last start call
64+
// elapsed returns the Duration since the last start call.
6565
pub fn (t StopWatch) elapsed() Duration {
6666
if t.start > 0 {
6767
if t.end == 0 {

‎vlib/time/time.c.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn convert_ctime(t C.tm, nanosecond int) Time {
115115
}
116116
}
117117

118-
// strftime returns the formatted time using `strftime(3)`
118+
// strftime returns the formatted time using `strftime(3)`.
119119
pub fn (t Time) strftime(fmt string) string {
120120
mut tm := &C.tm{}
121121
$if windows {

‎vlib/time/time.v‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,7 @@ pub fn (t Time) relative_short() string {
279279
return '${prefix}${y}y${suffix}'
280280
}
281281

282-
// day_of_week returns the current day of a given year, month, and day,
283-
// as an integer.
282+
// day_of_week returns the current day of a given year, month, and day, as an integer.
284283
pub fn day_of_week(y int, m int, d int) int {
285284
// Sakomotho's algorithm is explained here:
286285
// https://stackoverflow.com/a/6385934
@@ -365,7 +364,7 @@ pub fn days_in_month(month int, year int) !int {
365364
return res
366365
}
367366

368-
// debug returns detailed breakdown of time (`Time{ year: YYYY month: MM day: dd hour: HH: minute: mm second: ss nanosecond: nanos unix: unix }`)
367+
// debug returns detailed breakdown of time (`Time{ year: YYYY month: MM day: dd hour: HH: minute: mm second: ss nanosecond: nanos unix: unix }`).
369368
pub fn (t Time) debug() string {
370369
return 'Time{ year: ${t.year:04} month: ${t.month:02} day: ${t.day:02} hour: ${t.hour:02} minute: ${t.minute:02} second: ${t.second:02} nanosecond: ${t.nanosecond:09} unix: ${t.unix:07} }'
371370
}

‎vlib/time/time_windows.c.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn local_as_unix_time() i64 {
9999
return make_unix_time(*tm)
100100
}
101101

102-
// local - return the time `t`, converted to the currently active local timezone
102+
// local - return the time `t`, converted to the currently active local timezone.
103103
pub fn (t Time) local() Time {
104104
if t.is_local {
105105
return t

‎vlib/time/unix.v‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
// that can be found in the LICENSE file.
44
module time
55

6-
// unix returns a Time calculated from the given Unix timestamp in seconds since 1970-01-01
6+
// unix returns a Time calculated from the given Unix timestamp in seconds since 1970-01-01 .
77
pub fn unix(epoch i64) Time {
88
return unix_nanosecond(epoch, 0)
99
}
1010

11-
// unix_milli returns a Time calculated from the given Unix timestamp in milliseconds since 1970-01-01
11+
// unix_milli returns a Time calculated from the given Unix timestamp in milliseconds since 1970-01-01 .
1212
pub fn unix_milli(ms i64) Time {
1313
return ts_to_time_impl(ms, 1_000, 1_000_000)
1414
}
1515

16-
// unix_micro returns a Time calculated from the given Unix timestamp in microseconds since 1970-01-01
16+
// unix_micro returns a Time calculated from the given Unix timestamp in microseconds since 1970-01-01 .
1717
pub fn unix_micro(us i64) Time {
1818
return ts_to_time_impl(us, 1_000_000, 1_000)
1919
}
2020

21-
// unix_nano returns a Time calculated from the given Unix timestamp in nanoseconds since 1970-01-01
21+
// unix_nano returns a Time calculated from the given Unix timestamp in nanoseconds since 1970-01-01 .
2222
pub fn unix_nano(ns i64) Time {
2323
return ts_to_time_impl(ns, 1_000_000_000, 1)
2424
}
@@ -29,12 +29,12 @@ fn ts_to_time_impl(value i64, down i64, up i64) Time {
2929
return unix_nanosecond(epoch, int(remainder))
3030
}
3131

32-
// unix_microsecond returns a Time struct, given an Unix timestamp in seconds, and a microsecond value
32+
// unix_microsecond returns a Time struct, given an Unix timestamp in seconds, and a microsecond value.
3333
pub fn unix_microsecond(epoch i64, microsecond int) Time {
3434
return unix_nanosecond(epoch, microsecond * 1000)
3535
}
3636

37-
// unix_nanosecond returns a Time struct given a Unix timestamp in seconds and a nanosecond value
37+
// unix_nanosecond returns a Time struct given a Unix timestamp in seconds and a nanosecond value.
3838
pub fn unix_nanosecond(abs_unix_timestamp i64, nanosecond int) Time {
3939
// Split into day and time
4040
mut day_offset := abs_unix_timestamp / seconds_per_day

0 commit comments

Comments
 (0)