Giter VIP home page Giter VIP logo

Comments (4)

jeroen avatar jeroen commented on June 9, 2024

I can't reproduce this problem. When I run spell_check_package(".", vignettes = TRUE) in a pkg dir, the results do not include words from the README.md or DESCRIPTION if those words are in the wordlist.

I find it very strange that inst/inst/WORDLIST solves your problem. Are you running this inside a source package or installed package?

from spelling.

zappingseb avatar zappingseb commented on June 9, 2024

Hi. I created a repo to show our thing:

https://github.com/zappingseb/test_spelling

Inside this repo everything is fine on devtools::test() but it fails in devtools::check()

We created a second branch with the duplicated inst directory, where devtools::check works fine.

from spelling.

jeroen avatar jeroen commented on June 9, 2024

You have a very broken test setup. You are using testthat in which you load devtools and then you call spelling.

Your code doesn't work at all because you are running it on the installed package, which doesn't have the source code for the manual pages.

Can you please try instead to use spell_check_setup() to create the unit test? Or just copy the unit tests from any of the other packages that use spelling? So it looks like this: https://github.com/cran/curl/tree/master/tests

from spelling.

zappingseb avatar zappingseb commented on June 9, 2024

Thank you @jeroen

we noticed that our setup did not suite the spelling package

We changed the setup to this:

pkg <- get_package_info(source = TRUE)
if (grepl("lib", pkg$path)) {
  dir.create(file.path(pkg$path, "inst"))
  file.copy(file.path(pkg$path, "WORDLIST"), file.path(pkg$path, "inst/WORDLIST"))
}

test_that("misspelling", {
  spell_error <- spelling::spell_check_package(pkg, vignettes = TRUE, use_wordlist = TRUE)
  expect(
    nrow(spell_error) == 0,
    failure_message = apply(
      spell_error, 1,
      function(word) paste0("\nmisspelled word '", word[1], "' in ", word[2])
    ) %>%
      paste(collapse = "")
    )
})

This allowed us working with installed packages without screwing with your package.

Sorry for the inconvenience

from spelling.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.