Skip to content

Commit 287ba29

Browse files
committed
fix: assertions on detect/clean_comment_lines
1 parent 1223021 commit 287ba29

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

NEWS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
<!-- generated by R package codedoc; do not modify! -->
22

3+
## News for version 0.6.3
4+
5+
### codedoc::extract_keyed_comment_blocks
6+
7+
Fixed assertion on arg `detect_comment_lines`. Now allows for length > 1
8+
`character` vectors as documented.
9+
10+
### codedoc::extract_keyed_comment_blocks
11+
12+
Fixed assertion on arg `clean_comment_lines`. Now allows for length > 1
13+
`character` vectors as documented.
14+
15+
316
## News for version 0.6.2
417

518
### codedoc::pkg_doc_fun

R/collect_raw.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,30 @@ extract_keyed_comment_blocks_assertions__ <- function(
7070

7171
assert_arg_text_file_paths(text_file_paths)
7272

73+
# @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-03-27", "0.6.3")
74+
# Fixed assertion on arg `detect_comment_lines`. Now allows for length > 1
75+
# `character` vectors as documented.
76+
# @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-03-27", "0.6.3")
7377
dbc::assert_is_one_of(
7478
detect_comment_lines,
7579
funs = list(
7680
dbc::report_is_NULL,
7781
dbc::report_is_function,
78-
dbc::report_is_character_nonNA_atom
82+
dbc::report_is_character_nonNA_vector
7983
),
8084
call = call,
8185
assertion_type = assertion_type
8286
)
87+
# @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-03-27", "0.6.3")
88+
# Fixed assertion on arg `clean_comment_lines`. Now allows for length > 1
89+
# `character` vectors as documented.
90+
# @codedoc_comment_block news("codedoc::extract_keyed_comment_blocks", "2025-03-27", "0.6.3")
8391
dbc::assert_is_one_of(
8492
clean_comment_lines,
8593
funs = list(
8694
dbc::report_is_NULL,
8795
dbc::report_is_function,
88-
dbc::report_is_character_nonNA_atom
96+
dbc::report_is_character_nonNA_vector
8997
),
9098
call = call,
9199
assertion_type = assertion_type
@@ -338,7 +346,7 @@ extract_keyed_comment_blocks__ <- function(
338346
# - `character`: One or more regular expressions that a line must match to
339347
# be considered a comment line. You can supply file type-specific regexes
340348
# by using (lowercase) file type names as names of the vector. E.g.
341-
# `c(r = "^ *#+ *", sql = "^ *--{2,} *")`.
349+
# `c(r = "^ *#+ ?", sql = "^ *[-]{2,} ?")`.
342350
# - `function`: A function which takes lines of text as input and outputs a
343351
# logical vector of the same length as input which is `TRUE` when the line
344352
# is a comment line. If the function has argument `file_type`, the file

man/codedoc-package.Rd

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extract_keyed_comment_blocks.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)