Skip to content

lintr hangs on openxlsx #1443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JanMarvin opened this issue Jul 7, 2022 · 3 comments · Fixed by #1446
Closed

lintr hangs on openxlsx #1443

JanMarvin opened this issue Jul 7, 2022 · 3 comments · Fixed by #1446

Comments

@JanMarvin
Copy link

Hello,
in one of the many packages for which I use lintr, lintr started hanging after the last version 3.0. This can be reproduced both locally (R 4.2.1 on Mac and lintrs HEAD) and in the Github action.

lintr::lint_package() hangs on openxlsx. This can be seen with the latest CRAN release of openxlsx and also in the development branch. While the openxlsx code is known to be a mess, lintr did not hang before its release 3.0. Unfortunately there is not much else I can report, there is no verbose option that I am aware of. I tried to disable the linter mentioned in #1427 but that did not help. Let me know if you need anything else.

Thank you for the time you have invested in the development and maintenance of lintr!

@MichaelChirico
Copy link
Collaborator

Thanks for the report! I'm definitely reproducing strange slowness at current HEAD on openxlsx.

To debug, I start with:

trace(lintr::lint, at=1, quote(message(filename)))
lintr::lint_package()

this shows me what files are going slowly, and where it gets stuck.

R/wrappers.R is quite slow -- perhaps not surprising as it clocks in at 4K lines.

But where it really gets stuck is vignettes/Intro.Rmd. This is strange because the file is not very large.

It looks like get_source_expressions() is choking on that file; investigating why.

@MichaelChirico
Copy link
Collaborator

MichaelChirico commented Jul 10, 2022

OK, the issue is that there's a syntax error in the vignette:

ycphs/openxlsx#365

This is hidden because eval=FALSE in all the chunks. Maybe we should re-open #581?

It's not clear we're supposed to lint in chunks where eval=FALSE in the first place. But also, we shouldn't get stuck in an infinite loop in edge cases like this.

@JanMarvin
Copy link
Author

Thanks for the explanation and the successful bug hunt!

@MichaelChirico MichaelChirico added this to the 3.0.1 milestone Jul 25, 2022
@MichaelChirico MichaelChirico modified the milestones: 3.0.3, 3.1.0 Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants