Skip to content

Commit

Permalink
Fix tests, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
florianm committed Jul 22, 2024
1 parent d135c07 commit 317e92a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_stages: [commit]

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
name: Drop trailing whitespace
Expand All @@ -27,7 +27,7 @@ repos:
name: Detect private keys

- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.1
rev: v0.4.2
hooks:
- id: style-files
name: Style code to tidyverse conventions
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ Imports:
semver (>= 0.2.0),
tibble (>= 3.1.8),
tidyr (>= 1.3.0),
xml2 (>= 1.3.3),
skimr (>= 2.1.5)
xml2 (>= 1.3.3)
Suggests:
covr (>= 3.6.1),
DT (>= 0.27),
Expand All @@ -80,6 +79,7 @@ Suggests:
rmarkdown (>= 2.20),
roxygen2 (>= 7.2.3),
sf (>= 1.0-9),
skimr (>= 2.1.5),
terra (>= 1.7-3),
testthat (>= 3.1.6),
tmap (>= 3.3-3),
Expand All @@ -91,7 +91,7 @@ RdMacros:
Encoding: UTF-8
Language: en-AU
LazyData: true
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
X-schema.org-applicationCategory: Data Access
X-schema.org-keywords: database, open-data, opendatakit, odk, api, data, dataset
Remotes:
Expand Down
6 changes: 3 additions & 3 deletions inst/CITATION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
citHeader("To cite ruODK in publications use (with the respective version number:")
citHeader("To cite ruODK in publications use (with the correct version number:")

citEntry(
entry = "Misc",
bibentry(
bibtype = "Misc",
title = "ruODK: Client for the ODK Central API",
author = "Florian W. Mayer",
note = "R package version X.X.X",
Expand Down
20 changes: 14 additions & 6 deletions inst/rmarkdown/templates/odata/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ library(fs)
library(ruODK)
# Visualisation
library(skimr)
# require(skimr)
library(knitr)
library(DT)
# library(DT)
# Dissemination
library(readr)
Expand Down Expand Up @@ -138,9 +138,17 @@ data_sub2 <- ruODK::odata_submission_get(
<!--
Summarise, analyse, visualise the tibble(s) data (, data_sub1, data_sub2)
-->
```{r data_vis}
skimr::skim(data)
```{r data_vis_dplyr}
dplyr::glimpse(data)
```

For the next examples, have `skimr` and `DT` installed.

```{r data_vis_skimr, eval = requireNamespace("skimr")}
skimr::skim(data)
```

```{r data_vis_dt, eval = requireNamespace("DT")}
DT::datatable(head(data))
```

Expand Down Expand Up @@ -219,8 +227,8 @@ zip(zipfile = zip_fn, files = fs::dir_ls(loc))
# CKAN
#
# Upload to a CKAN data catalogue
# Needs url and API key of a write permitted user
# See ROpenSci package ckanr
# Needs CKAN_URL and API CKAN_KEY with org editor permissions
# See https://docs.ropensci.org/ckanr/
ckanr::ckanr_setup(url = Sys.getenv("CKAN_URL"), key = Sys.getenv("CKAN_KEY"))
ckan_ds_name <- "my-ckan-dataset-slug"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-entity_detail.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ test_that("entity_detail works", {

cn <- c(
"uuid",
"created_at",
"creator_id",
"conflict",
"created_at",
"updated_at",
"deleted_at",
"conflict",
"current_version"
# not unfolded:
# "current_version_created_at",
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-entity_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ test_that("entity_list works", {

cn <- c(
"uuid",
"created_at",
"creator_id",
"created_at",
"updated_at",
"deleted_at",
"current_version_created_at",
"current_version_current",
"current_version_label",
"current_version_creator_id",
"current_version_user_agent",
"current_version_version",
"current_version_base_version",
"current_version_conflicting_properties"
"current_version_conflicting_properties",
"current_version_created_at"
)

testthat::expect_equal(names(en), cn)
Expand Down

0 comments on commit 317e92a

Please sign in to comment.