Skip to content

Commit f237e0f

Browse files
committed
Revert "Automatically add needed cpp11 namespace directive (#1921)"
This reverts commit 9ac020d.
1 parent 6f089a4 commit f237e0f

File tree

4 files changed

+1
-17
lines changed

4 files changed

+1
-17
lines changed

.Rbuildignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@
2424
^internal$
2525
^revdep-cloud$
2626
^CRAN-SUBMISSION$
27-
^\.vscode$

NEWS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# usethis (development version)
22

3-
* `use_cpp11()` now automatically updates the `NAMESPACE` (@pachadotdev, #1921).
4-
53
# usethis 2.2.2
64

75
* Implicit usage of `numeric_version()` via comparison now always provides

R/cpp11.R

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use_cpp11 <- function() {
1212
check_installed("cpp11")
1313
check_is_package("use_cpp11()")
1414
check_uses_roxygen("use_cpp11()")
15-
check_has_package_doc("use_cpp11()")
1615
use_src()
1716

1817
use_dependency("cpp11", "LinkingTo")
@@ -25,11 +24,6 @@ use_cpp11 <- function() {
2524

2625
check_cpp_register_deps()
2726

28-
roxygen_ns_append(
29-
sprintf("@useDynLib %s, .registration = TRUE", project_name())
30-
)
31-
roxygen_update_ns()
32-
3327
invisible()
3428
}
3529

tests/testthat/test-cpp11.R

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ test_that("use_cpp11() requires a package", {
77
test_that("use_cpp11() creates files/dirs, edits DESCRIPTION and .gitignore", {
88
create_local_package()
99
use_roxygen_md()
10-
use_package_doc()
1110

1211
local_interactive(FALSE)
1312
local_check_installed()
14-
local_mocked_bindings(
15-
check_cpp_register_deps = function() invisible()
16-
# project_name = function() "testpkg"
17-
)
13+
local_mocked_bindings(check_cpp_register_deps = function() invisible())
1814

1915
use_cpp11()
2016

@@ -25,9 +21,6 @@ test_that("use_cpp11() creates files/dirs, edits DESCRIPTION and .gitignore", {
2521

2622
ignores <- read_utf8(proj_path("src", ".gitignore"))
2723
expect_contains(ignores, c("*.o", "*.so", "*.dll"))
28-
29-
namespace <- read_utf8(proj_path("NAMESPACE"))
30-
expect_match(namespace, "useDynLib", all = FALSE)
3124
})
3225

3326
test_that("check_cpp_register_deps is silent if all installed, emits todo if not", {

0 commit comments

Comments
 (0)