Skip to content

Commit

Permalink
Closes #200 fix spellcheck (#201)
Browse files Browse the repository at this point in the history
* introduce error for testing

* update spellcheck

* use newer rocker image

* use newer rocker image

* update

* fix spellcheck

* reduce checking

* fix spellcheck

* fix spellcheck

* fix spellcheck

* remove error

* fix spelling
  • Loading branch information
StefanThoma authored Jul 29, 2024
1 parent 78b7d71 commit a20fe32
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ on:
jobs:
Spelling:
runs-on: ubuntu-latest
container: {image: "rocker/tidyverse:4.2.1"}
container: {image: "rocker/tidyverse:4.3.1"}
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install spelling
run: if (!require("spelling")) install.packages("spelling")
- name: Install packages
run: |
if (!require("roxygen2")) install.packages("roxygen2")
if (!require("spelling")) install.packages("spelling")
if (!require("testthat")) install.packages("testthat")
shell: Rscript {0}

- name: Install roxygen2
run: if (!require("roxygen2")) install.packages("roxygen2")
shell: Rscript {0}

- name: Run Spelling Check test
run: spelling::spell_check_files(list.files(pattern = ".*.qmd$", recursive = TRUE), ignore = readr::read_lines("inst/WORDLIST.txt"))
shell: Rscript {0}

- name: Install testthat
run: if (!require("testthat")) install.packages("testthat")
shell: Rscript {0}

- name: test typos
run: testthat::test_that(desc = "No Typo", code = testthat::expect_equal(object = spelling::spell_check_files(list.files(pattern = ".*.qmd$", recursive = TRUE), ignore = readr::read_lines("inst/WORDLIST.txt")), expected = spelling::spell_check_files(path = "inst/WORDLIST.txt", ignore = readr::read_lines("inst/WORDLIST.txt"))))
- name: Check spelling
run: |
testthat::test_that(desc = "Check spelling",
code = {
typos <- spelling::spell_check_files(list.files(pattern = ".*.qmd$", recursive = TRUE), ignore = readr::read_lines("inst/WORDLIST.txt"))
print(typos)
testthat::expect_equal(
object = typos,
expected = spelling::spell_check_files(path = "inst/WORDLIST.txt", ignore = readr::read_lines("inst/WORDLIST.txt"))
)
}
)
shell: Rscript {0}
14 changes: 14 additions & 0 deletions inst/WORDLIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -821,3 +821,17 @@ Piraux
targetdatatype
TDF
TestDataFactory
ACTARM
AETERM
barchart
Berel
dataname
datanames
Demin
Dror
initializer
nolint
pak
Pavel
shinyApp
sparkline
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ When we run the app, this is what we will see in the web browser:

![](images/Asset 1.gif)

As you can see, with just a few lines of code, we were able to create a working app with some interesting capabilities. We have two datasets that we can switch between. For each dataset, we have keys defined (marked with a special key icon in the variable dropdown). When we filter one dataset, the other one gets filtered as well because they are connected with a key.
As you can see, with just a few lines of code, we were able to create a working app with some interesting capabilities. We have two datasets that we can switch between. For each dataset, we have keys defined (marked with a special key icon in the variable drop-down). When we filter one dataset, the other one gets filtered as well because they are connected with a key.

This is truly impressive, but there is just one problem… If we click the “Show R code” button, we will notice that the data used in the app is not “reproducible.” This simply means that the app currently does not have information about where the data comes from, so it cannot instruct users on how to obtain the same data.

Expand Down

0 comments on commit a20fe32

Please sign in to comment.