From 30b28400e87ed7dd5f5628dbc168294473be8ffc Mon Sep 17 00:00:00 2001 From: ThomasP-B Date: Sun, 9 Jul 2023 18:46:04 +0100 Subject: [PATCH 1/6] Disable warning when text file is missing final EOL --- R/interact.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/interact.R b/R/interact.R index 959d052..cf812e7 100644 --- a/R/interact.R +++ b/R/interact.R @@ -139,7 +139,7 @@ run_safely_loudly <- function(file) { set_log_element("result", ret$result$result) set_log_element("warnings", ret$warnings) set_log_element("errors", ret$result$error) - set_log_element("hash_sum", digest::sha1(readLines(file))) + set_log_element("hash_sum", digest::sha1(readLines(file, warn = FALSE))) # Session Info set_log_element("session_info", get_session_info()) From bdd9d8d12d4c11a69f89f647d8c3e9c59e105298 Mon Sep 17 00:00:00 2001 From: ThomasP-B Date: Sun, 9 Jul 2023 18:47:06 +0100 Subject: [PATCH 2/6] Create spell check workflow --- .github/workflows/spellcheck.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/spellcheck.yaml diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml new file mode 100644 index 0000000..3928703 --- /dev/null +++ b/.github/workflows/spellcheck.yaml @@ -0,0 +1,25 @@ +--- +name: Spellcheck + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + - dev + +jobs: + check: + runs-on: ubuntu-latest + name: Spellcheck + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Run Spelling Check test + uses: insightsengineering/r-spellcheck-action@v3 + with: + exclude: data/* From 9d1259155d1d7d808ef1ac184c18f6d98f7dc00b Mon Sep 17 00:00:00 2001 From: ThomasP-B Date: Mon, 24 Jul 2023 16:55:13 +0200 Subject: [PATCH 3/6] Add write packages permissions --- .github/workflows/spellcheck.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml index 3928703..967a32e 100644 --- a/.github/workflows/spellcheck.yaml +++ b/.github/workflows/spellcheck.yaml @@ -14,6 +14,8 @@ on: jobs: check: runs-on: ubuntu-latest + permissions: + packages: write name: Spellcheck steps: - name: Checkout repo From 2afa84e4166aed462dba8cf00478283ec81ef95b Mon Sep 17 00:00:00 2001 From: ThomasP-B Date: Mon, 21 Aug 2023 15:58:39 +0100 Subject: [PATCH 4/6] Rewrote action --- .github/workflows/spellcheck.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spellcheck.yaml b/.github/workflows/spellcheck.yaml index 967a32e..a055654 100644 --- a/.github/workflows/spellcheck.yaml +++ b/.github/workflows/spellcheck.yaml @@ -12,14 +12,20 @@ on: - dev jobs: - check: + spell: runs-on: ubuntu-latest - permissions: - packages: write - name: Spellcheck + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Checkout repo - uses: actions/checkout@v3 + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + needs: spelling - name: Run Spelling Check test uses: insightsengineering/r-spellcheck-action@v3 From 70c4329469a7429c15c0cb21a1bad2cbe8096422 Mon Sep 17 00:00:00 2001 From: ThomasP-B Date: Mon, 21 Aug 2023 16:13:45 +0100 Subject: [PATCH 5/6] Implemented spellcheck recommendations --- NEWS.md | 2 +- R/log.R | 2 +- inst/WORDLIST | 20 ++++++++++++++++++++ man/log_init.Rd | 2 +- vignettes/articles/tidylog.Rmd | 2 +- vignettes/execution.Rmd | 12 ++++++------ vignettes/logrx.Rmd | 2 +- 7 files changed, 31 insertions(+), 11 deletions(-) diff --git a/NEWS.md b/NEWS.md index d8764f4..8494fb9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # logrx 0.3.0 -- Moved website theme to bootstarp 5, enabled search (#179) +- Moved website theme to Bootstrap 5, enabled search (#179) - Add `include_rds` argument to `axecute()` to export log as rds file diff --git a/R/log.R b/R/log.R index ff80c3f..a030fef 100644 --- a/R/log.R +++ b/R/log.R @@ -1,6 +1,6 @@ ### Functions to initialise, configure, cleanup, and write the log.rx environment -#' Initialisation of the log.rx environment +#' Initialization of the log.rx environment #' #' `log_init()` initialises the log.rx environment #' diff --git a/inst/WORDLIST b/inst/WORDLIST index 526a8b7..32ac70d 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -15,3 +15,23 @@ SDTM tidyr rds logrx +addin +Angly +axecution +customizable +devtools +hashsum +Hotfix +Linter +linters +lintr +logrxpackage +param +Patil +Ren +repo +Rosenstock +Rscript +rx +sessionInfo +tidylog diff --git a/man/log_init.Rd b/man/log_init.Rd index 6900a69..6164303 100644 --- a/man/log_init.Rd +++ b/man/log_init.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/log.R \name{log_init} \alias{log_init} -\title{Initialisation of the log.rx environment} +\title{Initialization of the log.rx environment} \usage{ log_init() } diff --git a/vignettes/articles/tidylog.Rmd b/vignettes/articles/tidylog.Rmd index 138daf2..afecff0 100644 --- a/vignettes/articles/tidylog.Rmd +++ b/vignettes/articles/tidylog.Rmd @@ -28,7 +28,7 @@ Below we have a simple script using the `us_rent_income` dataset. We will explo
-Using `axecute(ex1_tidylog.R)` we produce a log file. Below we snapshot just the pertinent information for users interested in the `{tidylog}` feeback. This feedback is placed by the `{logrx}` package into the `Messages, Output, and Result` section of the log. +Using `axecute(ex1_tidylog.R)` we produce a log file. Below we snapshot just the pertinent information for users interested in the `{tidylog}` feedback. This feedback is placed by the `{logrx}` package into the `Messages, Output, and Result` section of the log.
diff --git a/vignettes/execution.Rmd b/vignettes/execution.Rmd index bc06725..c0e88f8 100644 --- a/vignettes/execution.Rmd +++ b/vignettes/execution.Rmd @@ -22,10 +22,10 @@ library(logrx) `logrx` has been built with both the flexibility of code execution and a number of different use cases in mind. While the basic case has been outlined in our [Get Started](https://pharmaverse.github.io/logrx/articles/logrx.html) vignette, here we will be discussing different methods of execution and creation of log files. These examples are meant to guide users who wish to explore different methods of execution or for those using ```logrx``` to create scripting. # Methods of Execution -Below you will find a number of examples for different methods of exectuion, these go in an increasing level of complexity and increasing level of technical knowledge. The below examples are meant to be starting points for those interested in using ```logrx``` in more complex settings. +Below you will find a number of examples for different methods of execution, these go in an increasing level of complexity and increasing level of technical knowledge. The below examples are meant to be starting points for those interested in using ```logrx``` in more complex settings. ## `axecute()` -The easiest of the execution methods to use is `axecute()`. This function can be used to exeucte code from an R terminal or using command line scripts. A log is +The easiest of the execution methods to use is `axecute()`. This function can be used to execute code from an R terminal or using command line scripts. A log is set-up around the program, and its code is run safely and loudly (using `safely()` from `{purrr}`). ```{r axecute, eval = FALSE} axecute("my_script.R") @@ -45,7 +45,7 @@ messages, output, and result. This must be passed an executable R file to run a * `log_write()` to generate and format the log -* `log_remove()` to remove the `log.rx` environment created by code exeuction +* `log_remove()` to remove the `log.rx` environment created by code execution ```{r log_*, eval = FALSE} log_config("my_script.R") @@ -55,7 +55,7 @@ log_remove() ``` ## Command Line Execution -While exeucting from an R terminal is nice if you have access to one, you can also execute your code using system command line. This is done using the `Rscript -e` command which executes a file using the registered Rscript executable. Below are a few examples of how to use the command line to execute a file and create a log as well as how to manipulate the outputs of the execution. These are likely to be advanced examples for most users. +While executing from an R terminal is nice if you have access to one, you can also execute your code using system command line. This is done using the `Rscript -e` command which executes a file using the registered Rscript executable. Below are a few examples of how to use the command line to execute a file and create a log as well as how to manipulate the outputs of the execution. These are likely to be advanced examples for most users. The below chunk will run the file my_script.R and output any standard output that is created by the execution of the file to the default location. ```{r, engine = 'bash', eval = FALSE} @@ -87,11 +87,11 @@ r_script_list <- list.files(path = ".", pattern = "\\.R$") lapply(r_script_list, axecute) ``` -Additionally, if you need your code to run using a shell scripting language such as bash these files can be created to run using the previously outlined Command Line Execution examples. The above scripting examples can be translated into a variety of different scritping languages. Below is an example where the bash script is executed in a directory of R files, this should execute all R files in the directory using `axecute()` and create a corresponding set of log files. +Additionally, if you need your code to run using a shell scripting language such as bash these files can be created to run using the previously outlined Command Line Execution examples. The above scripting examples can be translated into a variety of different scripting languages. Below is an example where the bash script is executed in a directory of R files, this should execute all R files in the directory using `axecute()` and create a corresponding set of log files. ```{r, engine = 'bash', eval = FALSE} for file in *.R; do [ -f "$file" ] || continue Rscript -e "logrx::axecute('$file')" done -``` \ No newline at end of file +``` diff --git a/vignettes/logrx.Rmd b/vignettes/logrx.Rmd index db5c0e2..f292a58 100644 --- a/vignettes/logrx.Rmd +++ b/vignettes/logrx.Rmd @@ -67,7 +67,7 @@ list of packages and functions * **Messages, Output and Results (optional)** - List Messages, Outputs and Results * **Log Output File** - Name and path of the log -Below we have a scrollabe example of what is included in a log file for an `adsl.R` script. +Below we have a scrollable example of what is included in a log file for an `adsl.R` script.