You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
roxygen2 (and hence devtoosl) no longer depends on stringr (or transitively, stringi), making
it easier to install in constrained Linux environments.
Replacements:
- `str_detect()` → `grepl()`
- `str_trim()` → `trimws()`
- `str_replace()` / `str_remove()` → `sub()`
- `str_replace_all()` → `gsub()` and local `re_replace_all()` helper
- `str_split()` → `strsplit()`
- `str_extract()` → `regexpr()` + `regmatches()`
- `str_count()` → local `re_count()` helper
- `str_sub()` → `substr()` / `substring()`
- `str_match()` → `regmatches()` + `regexec()`
- `str_match_all()` → `regmatches()` + `gregexec()`
- `str_locate_all()` → `gregexpr()`
- `str_split_fixed()` → local `re_split_half()` helper (only ever needed n=2)
Base R quirks worked around:
- `strsplit("", pattern)` returns `character(0)`, not `""` like stringr, so `tag_words()` now guards against empty input before splitting.
- `substr<-` can't change string length, so `str_sub<-` assignments were replaced with manual `paste0(left, val, right)` concatenation.
- `regmatches()` + `gregexec()` returns a list-of-matrices that needs `t()` to match stringr's column-oriented `str_match_all()` layout.
- `gregexpr()` returns a list with a single `-1` element (not zero-length) when there's no match, requiring an explicit `> 0` filter in `re_count()`.
- `stringr::fixed()` wrappers in tests were replaced with `fixed = TRUE` arguments to base functions.
- The `(?x)` free-spacing flag is used inline in `paste0()`-assembled regexps (since base R has no `regex(comments = TRUE)` wrapper), with comments placed on each `paste0()` line instead.
Copy file name to clipboardExpand all lines: NEWS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# roxygen2 (development version)
2
+
* roxygen2 no longer depends on stringr/stringi. This means that no package in the devtools constellation depends on stringr, which in turn means you no longer need stringi, making it a bit easier to install in constrained Linux environments.
2
3
* roxygen2 options can now be set using `Config/roxygen2/` fields in DESCRIPTION (e.g. `Config/roxygen2/markdown: TRUE`) instead of the `Roxygen` field. The old `Roxygen` field is still supported. Similarly, the roxygen2 version is now stored in `Config/roxygen2/version` instead of `RoxygenNote` (#1328).
3
4
* Tags that expect single-line input now warn when they span multiple lines, catching common mistakes. Affected tags: `@aliases`, `@concept`, `@encoding`, `@exportClass`, `@exportMethod`, `@exportPattern`, `@exportS3Method`, `@importFrom`, `@importClassesFrom`, `@importMethodsFrom`, `@include`, `@inheritParams`, `@keywords`, `@method`, `@name`, `@order`, `@rdname`, `@S3method`, `@template`, and `@useDynLib` (#1642, #1688). This may break some existing usage, but it prevents a wide class of otherwise silent errors.
4
5
*`@examplesIf` now warns when there is no example code after the condition (#1695).
0 commit comments