Skip to content

Commit

Permalink
Turn the R CMD check appendix into an online-only thing
Browse files Browse the repository at this point in the history
Two main pieces to this:

* Remove that file from O'Reilly's notion of the "manifest"
* Replace crossrefs from other chapters with a normal URL.

I've retained crossrefs within the chapter, but I think those should be OK.

Also removed vestigial section labels from `R-CMD-check.Rmd`. No good could possibly come from their existence.
  • Loading branch information
jennybc committed Mar 31, 2023
1 parent 4f4e0ba commit 6826154
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R-CMD-check.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ tools:::.check_package_CRAN_incoming
CRAN prefers at most one submission per month.
If you need to fix a major bug, be apologetic.

## Namespace {#namespace}
## Namespace

<!-- https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L4433 -->

Expand Down Expand Up @@ -431,7 +431,7 @@ It also automatically calls `devtools::document()` for you.
```
- **Checking compiled code**. Checks that you're not using any C functions that you shouldn't.

## Tests {#tests}
## Tests

<!-- https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L2514 -->

Expand All @@ -448,7 +448,7 @@ It also automatically calls `devtools::document()` for you.
Occasionally you may have a problem where the tests pass when run interactively with `devtools::test()`, but fail when in `R CMD check`.
This usually indicates that you've made a faulty assumption about the testing environment, and it's often hard to figure it out.

## Vignettes {#vignettes}
## Vignettes

This is a tricky enough topic that it also receives substantial coverage in the main body of the book; see @sec-vignettes-how-built-checked.

Expand Down
2 changes: 2 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ project:
- atlas.json
- images/cran-package-ggplot2-clean.png
- images/cran-checks-usethis-clean.png
post-render:
- post-render.ts

bibliography: book.bib

Expand Down
17 changes: 17 additions & 0 deletions post-render.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// The root book file
const rootFile = "_book/book-asciidoc/R-Packages--2e-.adoc";

// List of `lines` to replace in final file
const excludeFromFinal = [
"[appendix]",
"include::R-CMD-check.adoc[]"
];

// Read and replace
let contents = Deno.readTextFileSync(rootFile);
excludeFromFinal.forEach((exclude) => {
contents = contents.replace(`${exclude}\n`, "");
})

// Write updated file
Deno.writeTextFileSync(rootFile, contents);
2 changes: 1 addition & 1 deletion release.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ When running `R CMD check` for a CRAN submission, you have to address any proble
- Eliminate as many `NOTE`s as possible.
Each `NOTE` requires human oversight, which creates friction for both you and CRAN.
If there are notes that you do not believe are important, it is almost always easier to fix them (even if the fix is a bit of a hack) than to persuade CRAN that they're OK.
See @sec-r-cmd-check for details on how to fix individual problems.
See our [online-only guide to `R CMD check`](https://r-pkgs.org/R-CMD-check.html) for details on how to fix individual problems.

- If you can't eliminate a `NOTE`, list it in `cran-comments.md` and explain why you think it is spurious.
We discuss this file further in @sec-release-cran-comments.
Expand Down
2 changes: 1 addition & 1 deletion workflow101.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ The workflow for checking a package is simple, but tedious:
Make sure that doesn't lead to you ignoring other issues that really should be addressed.

`R CMD check` consists of dozens of individual checks and it would be overwhelming to enumerate them here.
Instead we explore them in detail in @sec-r-cmd-check.
See our [online-only guide to `R CMD check`](https://r-pkgs.org/R-CMD-check.html) for details.

### Background on `R CMD check`

Expand Down

0 comments on commit 6826154

Please sign in to comment.