Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc cleanup #52

Merged
merged 13 commits into from
Feb 1, 2024
Merged
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
^CITATION\.cff$
^doc$
^Meta$
R\.Rproj$
^codecov\.yml$
^cran-comments\.md$
^CRAN-SUBMISSION$
^\.lintr$
.Rprofile$
.Rprofile\.R$
6 changes: 3 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, devel]
pull_request:
branches: [main, master]
branches: [main, master, devel]

name: R-CMD-check

Expand All @@ -29,7 +29,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/check-full.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/check-release.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/check-standard.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/lint-project.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -41,7 +41,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
10 changes: 4 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Imports:
cli,
corrr,
Expand Down Expand Up @@ -69,6 +69,7 @@ Collate:
'grim-map.R'
'data-doc.R'
'data-frame-predicates.R'
'seq-predicates.R'
'function-map-seq.R'
'debit-map-seq.R'
'disperse.R'
Expand Down Expand Up @@ -108,19 +109,16 @@ Collate:
'scrutiny-package.R'
'seq-disperse.R'
'seq-length.R'
'seq-predicates.R'
'split-by-parens.R'
'subset-superset.R'
'utils-pipe.R'
'utils-tidy-eval.R'
'write-doc-audit.R'
Suggests:
covr,
devtools,
knitr,
pkgload,
rmarkdown,
roxygen2,
testthat (>= 3.0.0),
testthat (>= 3.0.0)
Config/testthat/edition: 3
Depends:
R (>= 3.4.0)
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ S3method(audit,scr_grimmer_map)
export("%>%")
export(":=")
export("seq_length<-")
export()
export(.data)
export(anti_trunc)
export(as_label)
Expand Down
2 changes: 1 addition & 1 deletion R/function-map-total-n.R
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function_map_total_n <- function(.fun, .reported, .name_test,
check_tibble(data)

# Make sure that the `n` column is present...
if (!any("n" == colnames(data))) {
if (!"n" %in% colnames(data)) {
cli::cli_abort(c(
"Column `n` missing.",
"i" = "`n` should contain the reported total sample sizes \\
Expand Down
4 changes: 2 additions & 2 deletions R/function-map.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ function_map <- function(.fun, .reported, .name_test,
})

code_rounding_class <-
if (any("rounding" == names(formals(.fun)))) {
if ("rounding" %in% names(formals(.fun))) {
rlang::expr({
dots <- rlang::enexprs(...)
if (any("rounding" == names(dots))) {
if ("rounding" %in% names(dots)) {
rounding_class <- dots$rounding
} else {
rounding_class <- formals(fun)$rounding
Expand Down
2 changes: 1 addition & 1 deletion R/method-dup-count.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @export

audit.scr_dup_count <- function(data) {
if (any(colnames(data) == "locations_n")) {
if ("locations_n" %in% colnames(data)) {
audit_summary_stats(data, c("count", "locations_n"))
} else {
audit_summary_stats(data, "count")
Expand Down
4 changes: 2 additions & 2 deletions R/method-grim-sequence.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

explain_seq_test_ranking <- function(x, scr_func_info) {

if (!any("lead_lag" == colnames(x))) {
if (!"lead_lag" %in% colnames(x)) {
x$lead_lag <- NA
}

Expand Down Expand Up @@ -110,7 +110,7 @@ explain_seq_test_ranking <- function(x, scr_func_info) {

seq_test_ranking <- function(x, explain = TRUE) {

if (!any("consistency" == colnames(x))) {
if (!"consistency" %in% colnames(x)) {
cli::cli_abort(c(
"Column `consistency` is missing.",
"i" = "Only run `seq_test_ranking()` on the output of a \\
Expand Down
2 changes: 1 addition & 1 deletion R/method-grimmer-map.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

audit.scr_grimmer_map <- function(data) {
out <- audit_cols_minimal(data, "GRIMMER")
if (any("reason" == colnames(data))) {
if ("reason" %in% colnames(data)) {
reason <- data$reason[!is.na(data$reason)]
fail_grim <- length(reason[stringr::str_detect(reason, "GRIM inconsistent")])
fail_test1 <- length(reason[stringr::str_detect(reason, "test 1")])
Expand Down
Loading
Loading