Skip to content

Commit 9ccd9b6

Browse files
integrating pkgcheck fixes
1 parent fb003f1 commit 9ccd9b6

7 files changed

Lines changed: 56 additions & 7 deletions

File tree

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Contributing to risAT
2+
3+
This outlines how to propose a change to risAT.
4+
For a detailed discussion on contributing to this and other tidyverse packages, please see the [development contributing guide](https://rstd.io/tidy-contrib) and our [code review principles](https://code-review.tidyverse.org/).
5+
6+
## Fixing typos
7+
8+
You can fix typos, spelling mistakes, or grammatical errors in the documentation directly using the GitHub web interface, as long as the changes are made in the _source_ file.
9+
This generally means you'll need to edit [roxygen2 comments](https://roxygen2.r-lib.org/articles/roxygen2.html) in an `.R`, not a `.Rd` file.
10+
You can find the `.R` file that generates the `.Rd` by reading the comment in the first line.
11+
12+
## Bigger changes
13+
14+
If you want to make a bigger change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed.
15+
If you’ve found a bug, please file an issue that illustrates the bug with a minimal
16+
[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed).
17+
See our guide on [how to create a great issue](https://code-review.tidyverse.org/issues/) for more advice.
18+
19+
### Pull request process
20+
21+
* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("werkstattcodes/risAT", fork = TRUE)`.
22+
23+
* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`.
24+
If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.
25+
* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`.
26+
27+
* Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser.
28+
The title of your PR should briefly describe the change.
29+
The body of your PR should contain `Fixes #issue-number`.
30+
31+
* For user-facing changes, add a bullet to the top of `NEWS.md` (i.e. just below the first header). Follow the style described in <https://style.tidyverse.org/news.html>.
32+
33+
### Code style
34+
35+
* New code should follow the tidyverse [style guide](https://style.tidyverse.org).
36+
You can use [Air](https://posit-dev.github.io/air/) to apply this style, but please don't restyle code that has nothing to do with your PR.
37+
38+
* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.
39+
40+
* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
41+
Contributions with test cases included are easier to accept.
42+
43+
## Code of Conduct
44+
45+
Please note that the risAT project is released with a
46+
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this
47+
project you agree to abide by its terms.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
importFrom(rlang,"%||%")
12
export(ris_parse_search)
23
export(ris_perform_case_law)
34
export(ris_req_case_law)

R/ris_case_law_utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ ris_build_case_law_params <- function(
242242
# -- Sorting, filtering, and pagination --
243243
ImRisSeit = ris_normalize_named_interval(in_ris_since),
244244
SortierungSortDirection = ris_normalize_sort_direction(sort_direction),
245-
SortierungSortedByColumn = sort_by,
245+
SortierungSortedByColumn = ris_normalize_case_law_sort_by(application_code, sort_by),
246246
# The API expects "true" (lowercase string) for these boolean flags, or
247247
# the parameter should be absent entirely (not "false").
248248
# These are compound parameters under "Dokumenttyp" — the API requires

R/ris_parse_search.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#'
1111
#' @return A tibble parsed from one RIS response payload.
1212
#' Includes list-columns `content_urls` and `app_metadata`.
13+
#' @importFrom rlang %||%
1314
#' @export
1415
#'
1516
#' @examples
@@ -71,7 +72,7 @@ ris_parse_search <- function(
7172

7273
rows <- purrr::map(
7374
document_refs,
74-
~ ris_reference_to_tibble_row(.x, response_meta)
75+
\(doc) ris_reference_to_tibble_row(doc, response_meta)
7576
)
7677

7778
ris_bind_rows_harmonized(rows)
@@ -339,10 +340,6 @@ ris_to_snake_case <- function(x) {
339340
stringr::str_replace_all("^_+|_+$", "")
340341
}
341342

342-
`%||%` <- function(x, y) {
343-
if (is.null(x)) y else x
344-
}
345-
346343
# ============================================================================
347344
# Column name translation: German snake_case -> English
348345
# ============================================================================

_internal/tryOut.r

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
climateChange <- risAT::ris_search_vfgh(query="Folter", echo = T, search_decision_text = T)
2+
3+

tests/testthat/test-ris_parse_search.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test_that("ris_parse_search returns tibble with required list-columns", {
5555
expect_true("content_urls" %in% names(out))
5656
expect_true("app_metadata" %in% names(out))
5757
expect_type(out$content_urls[[1]], "character")
58-
expect_equal(length(out$content_urls[[1]]), 2L)
58+
expect_length(out$content_urls[[1]], 2)
5959
expect_type(out$app_metadata[[1]], "list")
6060
expect_true("id" %in% names(out))
6161
expect_true("document_url" %in% names(out))

0 commit comments

Comments
 (0)