Skip to content

lintr not working with travis any longer #742

Closed

Description

@IndrajeetPatil

I've been using lintr with travis since a long time, and it has always worked, but it has stopped working since a last few days, and I am not sure why.

The exact error I see is:

84.56s$ Rscript -e 'lintr::lint_package()'
Error in rep.int(character, length) : invalid 'times' value
Calls: <Anonymous> ... FUN -> cat -> highlight_string -> fill_with -> paste0
Execution halted
Done. Your build exited with 0.

Activity

  1. AshesITR commented on Feb 9, 2021

    @AshesITR
    Collaborator

    Can you reproduce this locally with the current lintr master?

  2. IndrajeetPatil commented on Feb 9, 2021

    @IndrajeetPatil
    ContributorAuthor

    It works without any problem on my local Windows machine and also on MacOS in github-actions.

    But Travis-CI is running lintr on Ubuntu machines, and I don't have access to one.

  3. AshesITR commented on Feb 9, 2021

    @AshesITR
    Collaborator

    That is very curious.
    It might be related to non-ascii characters.

    Could you have travis run dput(lintr::lint_package()) as a test instead?
    That should give us the list of lints it tries to print before dying.

  4. IndrajeetPatil commented on Feb 12, 2021

    @IndrajeetPatil
    ContributorAuthor

    Hmm, I don't think there is anything amiss from lintr's side here, since it works with travis just fine with my other repository.

    I will close this and see what is special with ggstatsplot's behavior on travis.

  5. added
    bug
    on Feb 13, 2021
  6. AshesITR commented on Feb 13, 2021

    @AshesITR
    Collaborator

    I could reproduce when writing a test for expect_lint_free.
    Here's the root cause:

      withr::with_envvar(
        c(NOT_CRAN = "true", R_COVR = "false"),
        expect_failure(expect_lint_free("dummy_packages/package"))
      )
    

    Yields

    Error (test-expect_lint.R:58:3): expect_lint_free works
    Error: invalid 'times' value
    Backtrace:
      1. withr::with_envvar(c(NOT_CRAN = "true", R_COVR = "false"), expect_failure(expect_lint_free("dummy_packages/package"))) test-expect_lint.R:58:2
      9. lintr::expect_lint_free("dummy_packages/package")
     17. lintr::print.lints(lints)
     18. base::lapply(x, print, ...) D:/Projects/R/lintr/R/methods.R:78:6
     20. lintr::print.lint(X[[i]], ...)
     22. lintr::highlight_string(x$message, x$column_number, x$ranges) D:/Projects/R/lintr/R/methods.R:11:2
     23. lintr::fill_with(" ", maximum) D:/Projects/R/lintr/R/lint.R:493:2
     25. base::rep.int(character, length)
    
  7. AshesITR commented on Feb 13, 2021

    @AshesITR
    Collaborator

    Tracked it down to the commented_code_linter yielding NA

  8. added a commit that references this issue on Feb 13, 2021
    5a99ba6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions