Skip to content

Commit

Permalink
Run pre-commit on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
florianm committed Apr 2, 2024
1 parent bd4e386 commit d135c07
Show file tree
Hide file tree
Showing 36 changed files with 258 additions and 256 deletions.
6 changes: 5 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y install --no-install-recommends \
libudunits2-dev libxtst6 libxt6 libmagick++-dev \
make git procps locales curl && \
libxml2-dev libjq-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev \
libicu-dev libv8-dev libjq-dev libprotobuf-dev protobuf-compiler libgit2-dev \
rsync mdbtools cargo libavfilter-dev libfontconfig1-dev libopenblas-dev \
freetds-common libct4 libsybdb5 freetds-bin freetds-dev libsybdb5 tdsodbc \
unixodbc make git procps locales curl && \
rm -rf /var/lib/apt/lists/*

# generating locales
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
]
}
}
}
}
30 changes: 15 additions & 15 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,34 @@ assignees: florianm
---

## Problem
<!--
<!--
Please briefly describe your problem.
-->
## ruODK function(s) used
<!--
<!--
The most important bit - which ruODK functions did you use?
-->

## Unexpected behaviour
<!--
<!--
Run the failing commands with verbose=TRUE and provide any error messages,
and the time elapsed. Did the command fail straight away or run for a while?
Could this be a networking issue or performance issues on the ODK Central server?
-->

## Reproducible example
<!--
If this issue refers to a bug or unexpected behaviour of ruODK,
please include a minimal reproducible example
([reprex](https://reprex.tidyverse.org/), see also
<https://www.tidyverse.org/help/#reprex>).
Note: If this issue involves an authenticated web request,
<!--
If this issue refers to a bug or unexpected behaviour of ruODK,
please include a minimal reproducible example
([reprex](https://reprex.tidyverse.org/), see also
<https://www.tidyverse.org/help/#reprex>).
Note: If this issue involves an authenticated web request,
do not include your credentials, server address, or any identifying
information.
information.
Instead, run ru_setup() with environment variables.
Make sure to sanitise any output of credentials, too.
The failing function and the (sanitised) error output alone
will be a welcome help to narrow down the problem.
-->
Expand All @@ -47,12 +47,12 @@ assignees: florianm
<details>
<summary><strong>Session Info</strong></summary>

<!--
<!--
Append "version.txt" to your ODK Central URL
-->
ODK Central version:
<!--

<!--
R versions: R, ruODK, loaded packages
-->
```{r}
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ repos:
name: Ensure that no debug() statement is committed
- id: no-browser-statement
name: Ensure that no browser() statement is committed
- id: spell-check
name: Spellcheck
# - id: spell-check
# name: Spellcheck
- id: deps-in-desc
name: Ensure that DESCRIPTION lists all dependencies
- id: use-tidy-description
Expand Down
12 changes: 6 additions & 6 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, we pledge to respect all people who
As contributors and maintainers of this project, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating documentation,
submitting pull requests or patches, and other activities.

Expand All @@ -13,13 +13,13 @@ imagery, derogatory comments or personal attacks, trolling, public or private ha
insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed
commits, code, wiki edits, issues, and other contributions that are not aligned to this
Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed
from the project team.

Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported by
Instances of abusive, harassing, or otherwise unacceptable behaviour may be reported by
opening an issue or contacting one or more of the project maintainers.

This Code of Conduct is adapted from the Contributor Covenant
(<http://contributor-covenant.org>), version 1.0.0, available at
This Code of Conduct is adapted from the Contributor Covenant
(<http://contributor-covenant.org>), version 1.0.0, available at
<http://contributor-covenant.org/version/1/0/0/>
82 changes: 41 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing
# Contributing
This contributing guide has been derived from the `tidyverse` boilerplate.
Where it seems over the top, common sense is appreciated, and every contribution
is appreciated.
Expand Down Expand Up @@ -31,34 +31,34 @@ If you would like to contribute to the code base, follow the process below.
* [Code of Conduct](#code-of-conduct)

This explains how to propose a change to `ruODK` via a pull request using
Git and GitHub.
Git and GitHub.

For more general info about contributing to `ruODK`, see the
For more general info about contributing to `ruODK`, see the
[Resources](#resources) at the end of this document.

### Naming conventions
ruODK names functions after ODK Central endpoints. If there are aliases, such as
"Dataset" and "Entity List", choose the alias that is shown to Central users
(here, choose "Entity List") over internally used terms.

Function names combine the object name (`project`, `form`, `submission`,
`attachment`, `entitylist`, `entity`, etc.) with the action (`list`, `detail`,
`patch`) as snake case, e.g. `project_list()`.
Function names combine the object name (`project`, `form`, `submission`,
`attachment`, `entitylist`, `entity`, etc.) with the action (`list`, `detail`,
`patch`) as snake case, e.g. `project_list()`.
In case of any uncertainty, discussion is welcome.

In contrast, `pyODK` uses a class based approach with the pluralised object name
In contrast, `pyODK` uses a class based approach with the pluralised object name
separated from the action `client.entity_lists.list()`.

Documentation should capitalise ODK Central object names: Project, Form,
Documentation should capitalise ODK Central object names: Project, Form,
Submission, Entity.

### Prerequisites
To test the package, you will need valid credentials for an existing ODK Central
To test the package, you will need valid credentials for an existing ODK Central
instance to be used as a test server.

Before you do a pull request, you should always file an issue and make sure
the maintainers agree that it is a problem, and is happy with your basic proposal
for fixing it.
the maintainers agree that it is a problem, and is happy with your basic proposal
for fixing it.
If you have found a bug, follow the issue template to create a minimal
[reprex](https://www.tidyverse.org/help/#reprex) if you can do so without
revealing sensitive information. Never include credentials in your reprex.
Expand All @@ -75,16 +75,16 @@ In the function documentation, include the following components:
* Title
* Lifecycle badge
* Documentation from the official ODK Central API docs
* Additional paragraphs (see e.g. `entity_detail.R`): Factor out commonly used
* Additional paragraphs (see e.g. `entity_detail.R`): Factor out commonly used
text fragments into `man-roxygen` fragments.
* Link the relevant ODK Central API docs and surround the link with `# nolint start / end` mufflers for linter warnings about the line length.
* Link to the correct reference family topic. If adding a new topic,
* Link to the correct reference family topic. If adding a new topic,
update `pkgdown.yml`.
* List all parameters and export the function as usual.
* Add examples showing basic usage inside a `\dontrun{}` block. Examples have
no access to the test server and will only work for internal helpers which
do not access the ODK Central API.

Inside the function:

* Gatecheck for missing parameters via `yell_if_missing`.
Expand All @@ -99,15 +99,15 @@ Link to tests:

#### Adding a dependency
* Update DESCRIPTION
* Update GH Actions install workflows - do R package deps have system deps?
* Update GH Actions install workflows - do R package deps have system deps?
Can GHA install them in all environments?
* Update Dockerfile
* Update binder install.R
* Update installation instructions

#### Renaming a vignette
* Search-replace all links to the vignette throughout
* ruODK,
* Search-replace all links to the vignette throughout
* ruODK,
* ODK Central "OData" modal
* ODK Central docs

Expand All @@ -133,14 +133,14 @@ Link to tests:

#### Fork, clone, branch

The first thing you'll need to do is to [fork](https://help.github.com/articles/fork-a-repo/)
the [`ruODK` GitHub repo](https://github.com/ropensci/ruODK), and
The first thing you'll need to do is to [fork](https://help.github.com/articles/fork-a-repo/)
the [`ruODK` GitHub repo](https://github.com/ropensci/ruODK), and
then clone it locally. We recommend that you create a branch for each PR.

#### Check

Before changing anything, make sure the package still passes the below listed
flavours of `R CMD check` locally for you.
flavours of `R CMD check` locally for you.

```r
goodpractice::goodpractice(quiet = FALSE)
Expand All @@ -150,9 +150,9 @@ chk <- rcmdcheck::rcmdcheck(args = c("--as-cran"))

#### Style

Match the existing code style. This means you should follow the tidyverse
[style guide](http://style.tidyverse.org). Use the
[styler](https://CRAN.R-project.org/package=styler) package to apply the style
Match the existing code style. This means you should follow the tidyverse
[style guide](http://style.tidyverse.org). Use the
[styler](https://CRAN.R-project.org/package=styler) package to apply the style
guide automatically.

Be careful to only make style changes to the code you are contributing. If you
Expand All @@ -170,15 +170,15 @@ spelling::update_wordlist()

#### Document

We use [roxygen2](https://cran.r-project.org/package=roxygen2), specifically with the
We use [roxygen2](https://cran.r-project.org/package=roxygen2), specifically with the
[Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/markdown.html),
to create `NAMESPACE` and all `.Rd` files. All edits to documentation
should be done in roxygen comments above the associated function or
object. Then, run `devtools::document()` to rebuild the `NAMESPACE` and `.Rd`
object. Then, run `devtools::document()` to rebuild the `NAMESPACE` and `.Rd`
files.

See the `RoxygenNote` in [DESCRIPTION](DESCRIPTION) for the version of
roxygen2 being used.
roxygen2 being used.

```r
spelling::spell_check_package()
Expand All @@ -195,9 +195,9 @@ if (fs::file_info("README.md")$modification_time <
#### Test

We use [testthat](https://cran.r-project.org/package=testthat). Contributions
with test cases are easier to review and verify.
with test cases are easier to review and verify.

To run tests and build the vignettes, you'll need access to the
To run tests and build the vignettes, you'll need access to the
[ruODK test server](https://odkc.dbca.wa.gov.au/).
If you haven't got an account yet, create an [accont request issue](https://github.com/ropensci/ruODK/issues/new/choose)
to request access to this ODK Central instance.
Expand Down Expand Up @@ -235,7 +235,7 @@ ODKC_UN="..."
ODKC_PW="..."
```

Keep in mind that `ruODK` defaults to use `ODKC_{URL,UN,PW}`, so for everyday
Keep in mind that `ruODK` defaults to use `ODKC_{URL,UN,PW}`, so for everyday
use outside of contributing, you will want to use your own `ODKC_{URL,UN,PW}`
account credentials.

Expand Down Expand Up @@ -278,39 +278,39 @@ title) to automatically close the issue when the PR is merged.
Once you've pushed your commit(s) to a branch in _your_ fork, you're ready to
make the pull request. Pull requests should have descriptive titles to remind
reviewers/maintainers what the PR is about. You can easily view what exact
changes you are proposing using either the [Git diff](http://r-pkgs.had.co.nz/git.html#git-status)
view in RStudio, or the [branch comparison view](https://help.github.com/articles/creating-a-pull-request/)
you'll be taken to when you go to create a new PR. If the PR is related to an
issue, provide the issue number and slug in the _description_ using
changes you are proposing using either the [Git diff](http://r-pkgs.had.co.nz/git.html#git-status)
view in RStudio, or the [branch comparison view](https://help.github.com/articles/creating-a-pull-request/)
you'll be taken to when you go to create a new PR. If the PR is related to an
issue, provide the issue number and slug in the _description_ using
auto-linking syntax (e.g. `#15`).

#### Check the docs
Double check the output of the
[rOpenSci documentation CI](https://dev.ropensci.org/job/ruODK/lastBuild/console)
Double check the output of the
[rOpenSci documentation CI](https://dev.ropensci.org/job/ruODK/lastBuild/console)
for any breakages or error messages.

#### Review, revise, repeat

The latency period between submitting your PR and its review may vary.
When a maintainer does review your contribution, be sure to use the same
The latency period between submitting your PR and its review may vary.
When a maintainer does review your contribution, be sure to use the same
conventions described here with any revision commits.

### Resources

* [Happy Git and GitHub for the useR](http://happygitwithr.com/) by Jenny Bryan.
* [Contribute to the tidyverse](https://www.tidyverse.org/contribute/) covers
* [Contribute to the tidyverse](https://www.tidyverse.org/contribute/) covers
several ways to contribute that _don't_ involve writing code.
* [Contributing Code to the Tidyverse](http://www.jimhester.com/2017/08/08/contributing/) by Jim Hester.
* [R packages](http://r-pkgs.had.co.nz/) by Hadley Wickham.
* [Git and GitHub](http://r-pkgs.had.co.nz/git.html)
* [Automated checking](http://r-pkgs.had.co.nz/check.html)
* [Object documentation](http://r-pkgs.had.co.nz/man.html)
* [Testing](http://r-pkgs.had.co.nz/tests.html)
* [dplyr’s `NEWS.md`](https://github.com/tidyverse/dplyr/blob/master/NEWS.md)
* [dplyr’s `NEWS.md`](https://github.com/tidyverse/dplyr/blob/master/NEWS.md)
is a good source of examples for both content and styling.
* [Closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)
* [Closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)
on GitHub.
* [Autolinked references and URLs](https://help.github.com/articles/autolinked-references-and-urls/)
* [Autolinked references and URLs](https://help.github.com/articles/autolinked-references-and-urls/)
on GitHub.
* [GitHub Guides: Forking Projects](https://guides.github.com/activities/forking/).

Expand Down
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ Imports:
semver (>= 0.2.0),
tibble (>= 3.1.8),
tidyr (>= 1.3.0),
xml2 (>= 1.3.3)
xml2 (>= 1.3.3),
skimr (>= 2.1.5)
Suggests:
covr (>= 3.6.1),
DT (>= 0.27),
Expand Down
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU General Public License
==========================

_Version 3, 29 June 2007_
_Version 3, 29 June 2007_
_Copyright © 2007 Free Software Foundation, Inc. &lt;<http://fsf.org/>&gt;_

Everyone is permitted to copy and distribute verbatim copies of this license
Expand Down Expand Up @@ -193,7 +193,7 @@ You may convey a work based on the Program, or the modifications to produce it f
the Program, in the form of source code under the terms of section 4, provided that
you also meet all of these conditions:

* **a)** The work must carry prominent notices stating that you modified it, and giving a
* **a)** The work must carry prominent notices stating that you modified it, and giving a
relevant date.
* **b)** The work must carry prominent notices stating that it is released under this
License and any conditions added under section 7. This requirement modifies the
Expand Down
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ coverage:
threshold: 1%
ignore:
- "R/utils-lifecycle.R"

16 changes: 8 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@

Resolved NOTE comments:
* Possibly invalid URLs:
* The package comparison section in the README contains Markdown badges with
* The package comparison section in the README contains Markdown badges with
CRAN links to packages that are not yet or not any more on CRAN. These
links are correct, and while they currently do not resolve, they will do so
links are correct, and while they currently do not resolve, they will do so
once the packages are (re-)submitted to CRAN. Currently removed.
* The README contains an ODK Central form OData service URL to illustrate
* The README contains an ODK Central form OData service URL to illustrate
setting up ruODK. The URL redirects to a login screen if followed directly.
This is expected behaviour. Currently not appearing as warning.
* The PDF version of the manual is now included.
* The example data contains UTF-8 strings. This is a realistic scenario.
* The example data contains UTF-8 strings. This is a realistic scenario.
The note has disappeared after the R version 4 release.
* Test coverage: All functionality supporting the current ODK Central release is
covered by tests.
The only exception is `form_schema{_parse}`, which supports a breaking
* Test coverage: All functionality supporting the current ODK Central release is
covered by tests.
The only exception is `form_schema{_parse}`, which supports a breaking
change between ODK Central 0.7 and 0.8. The test server runs ODK Central 0.8,
a production server (used by the package author, but not accessible to other
a production server (used by the package author, but not accessible to other
maintainers) runs 0.7 successfully. The tests for v 0.7 use packaged data.
Loading

0 comments on commit d135c07

Please sign in to comment.