Skip to content

Commit 40b574b

Browse files
authored
tools,v.doc: move vlib/v/doc/ to cmd/tools/vdoc/doc/ to reduce the runtime of the CI runs, when v doc is changed (#23483)
1 parent c680984 commit 40b574b

File tree

18 files changed

+29
-29
lines changed

18 files changed

+29
-29
lines changed

TESTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ tests in the main V repository, for example:
188188

189189
> [!NOTE]
190190
The VDOC test vdoc_file_test.v now also supports VAUTOFIX, which is
191-
useful, if you change anything inside cmd/tools/vdoc or vlib/v/doc/,
191+
useful, if you change anything inside cmd/tools/vdoc,
192192
or inside the modules that it depends on (like markdown).
193193
After such changes, just run this command *2 times*, and commit the
194194
resulting changes in `cmd/tools/vdoc/testdata` as well:
File renamed without changes.

vlib/v/doc/doc.v renamed to cmd/tools/vdoc/doc/doc.v

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -536,28 +536,28 @@ pub fn generate(input_path string, pub_only bool, with_comments bool, platform P
536536
if platform == .js {
537537
return error('vdoc: Platform `${platform}` is not supported.')
538538
}
539-
mut doc := new(input_path)
540-
doc.pub_only = pub_only
541-
doc.with_comments = with_comments
542-
doc.filter_symbol_names = filter_symbol_names.filter(it.len != 0)
543-
doc.prefs.os = if platform == .auto {
539+
mut d := new(input_path)
540+
d.pub_only = pub_only
541+
d.with_comments = with_comments
542+
d.filter_symbol_names = filter_symbol_names.filter(it.len != 0)
543+
d.prefs.os = if platform == .auto {
544544
pref.get_host_os()
545545
} else {
546546
unsafe { pref.OS(int(platform)) }
547547
}
548-
doc.generate()!
549-
return doc
548+
d.generate()!
549+
return d
550550
}
551551

552552
// generate_with_pos has the same function as the `generate` function but
553553
// accepts an offset-based position and enables the comments by default.
554554
pub fn generate_with_pos(input_path string, filename string, pos int) !Doc {
555-
mut doc := new(input_path)
556-
doc.pub_only = false
557-
doc.with_comments = true
558-
doc.with_pos = true
559-
doc.filename = filename
560-
doc.pos = pos
561-
doc.generate()!
562-
return doc
555+
mut d := new(input_path)
556+
d.pub_only = false
557+
d.with_comments = true
558+
d.with_pos = true
559+
d.filename = filename
560+
d.pos = pos
561+
d.generate()!
562+
return d
563563
}

vlib/v/doc/doc_private_fn_test.v renamed to cmd/tools/vdoc/doc/doc_private_fn_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ fn test_get_parent_mod_normal_cases() {
4343
assert get_parent_mod(os.join_path(@VMODROOT, 'vlib', 'os', 'os.v'))? == 'os'
4444
assert get_parent_mod(os.join_path(@VMODROOT, 'cmd'))? == ''
4545
assert get_parent_mod(os.join_path(@VMODROOT, 'cmd', 'tools', 'modules', 'testing',
46-
'common.v'))? == 'testing'
46+
'common.v'))? == 'tools.modules.testing'
4747
}

vlib/v/doc/doc_test.v renamed to cmd/tools/vdoc/doc/doc_test.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// import v.ast
2-
import v.doc
2+
import doc
33

44
// fn test_generate_with_pos() {}
55
// fn test_generate() {}
File renamed without changes.
File renamed without changes.

vlib/v/doc/utils.v renamed to cmd/tools/vdoc/doc/utils.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub fn merge_doc_comments(comments []DocComment) string {
107107
for key in highlight_keys {
108108
if ll.starts_with(key) {
109109
comment += '\n\n${key.title()}${l[key.len..]}'
110-
// Workaround for compiling with `v -cstrict -cc gcc vlib/v/doc/doc_test.v`
110+
// Workaround for compiling with `v -cstrict -cc gcc cmd/tools/vdoc/doc/doc_test.v`
111111
// and using multiple continue `<label>`.
112112
continue_line_loop = true
113113
break

cmd/tools/vdoc/html.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import markdown
88
import v.scanner
99
import v.ast
1010
import v.token
11-
import v.doc
11+
import doc
1212
import v.pref
1313
import v.util { tabs }
1414

cmd/tools/vdoc/main.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module main
33
import os
44
import os.cmdline
55
import term
6-
import v.doc
6+
import doc
77
import v.vmod
88

99
const vexe = os.getenv_opt('VEXE') or { @VEXE }

0 commit comments

Comments
 (0)