From 309cc125e82d6efd8fa28a68e843dd3cf1c611de Mon Sep 17 00:00:00 2001 From: Stephanie Spielman Date: Thu, 6 Jun 2024 08:51:48 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Joshua Shapiro --- Dockerfile | 2 +- spell-check.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cfe4893..a17e33e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.authors="CCDL ccdl@alexslemonade.org" LABEL org.opencontainers.image.source="https://github.com/AlexsLemonade/spellcheck/tree/main" # install R package dependencies from CRAN -RUN Rscript -e "install.packages(c('spelling', 'readr', 'purrr', 'dplyr', 'tidyr'))" +RUN Rscript -e "install.packages(c('dplyr', 'purrr', 'readr', 'spelling', 'tidyr'))" # add spell check script and make it executable COPY spell-check.R /spell-check.R diff --git a/spell-check.R b/spell-check.R index afc1072..f91e69b 100644 --- a/spell-check.R +++ b/spell-check.R @@ -42,7 +42,7 @@ spelling_errors <- file_list |> purrr::imap( \(files, path) { spelling::spell_check_files(files, ignore = dictionary) |> - data.frame() |> + data.frame() |> tidyr::unnest(cols = found) |> tidyr::separate(found, into = c("file", "lines"), sep = ":") |> dplyr::mutate(file = file.path(path, file))