@@ -14,6 +14,7 @@ const (
14
14
too_long_line_length = 100
15
15
term_colors = term.can_show_color_on_stderr ()
16
16
hide_warnings = '-hide-warnings' in os.args || '-w' in os.args
17
+ show_progress = os.getenv ('GITHUB_JOB' ) == '' && '-silent' ! in os.args
17
18
non_option_args = cmdline.only_non_options (os.args[2 ..])
18
19
)
19
20
@@ -41,6 +42,10 @@ fn main() {
41
42
println ('´-all´ flag is deprecated. Please use ´v check-md .´ instead.' )
42
43
exit (1 )
43
44
}
45
+ if show_progress {
46
+ // this is intended to be replaced by the progress lines
47
+ println ('' )
48
+ }
44
49
mut files_paths := non_option_args.clone ()
45
50
mut res := CheckResult{}
46
51
if term_colors {
@@ -64,6 +69,9 @@ fn main() {
64
69
}
65
70
res + = mdfile.check ()
66
71
}
72
+ if res.errors == 0 && show_progress {
73
+ term.clear_previous_line ()
74
+ }
67
75
if res.warnings > 0 || res.errors > 0 || res.oks > 0 {
68
76
println ('\n Warnings: $res.warnings | Errors: $res.errors | OKs: $res.oks ' )
69
77
}
@@ -145,9 +153,17 @@ mut:
145
153
state MDFileParserState = .markdown
146
154
}
147
155
156
+ fn (mut f MDFile) progress (message string ) {
157
+ if show_progress {
158
+ term.clear_previous_line ()
159
+ println ('File: ${f.path:-30s} , Lines: ${f.lines.len:5} , $message ' )
160
+ }
161
+ }
162
+
148
163
fn (mut f MDFile) check () CheckResult {
149
164
mut res := CheckResult{}
150
165
for j, line in f.lines {
166
+ // f.progress('line: $j')
151
167
if line.len > too_long_line_length {
152
168
if f.state == .vexample {
153
169
wprintln (wline (f.path, j, line.len, 'long V example line' ))
@@ -265,6 +281,7 @@ fn (mut f MDFile) check_examples() CheckResult {
265
281
mut acommands := e.command.split (' ' )
266
282
nofmt := 'nofmt' in acommands
267
283
for command in acommands {
284
+ f.progress ('example from $e.sline to $e.eline , command: $command ' )
268
285
fmt_res := if nofmt { 0 } else { get_fmt_exit_code (vfile, vexe) }
269
286
match command {
270
287
'compile' {
0 commit comments