Skip to content
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

Do not handle warnings when options("warn") >= 2 #721

Merged
merged 4 commits into from
Mar 30, 2018

Conversation

yutannihilation
Copy link
Contributor

When options("warn") >= 2, a warning is converted into an error. So, in that case, we should not handle it by the warning handler, but do nothing and let it handled by the error handler.

This usually won't be a problem, except when a package has some tricky tests that change the value of options("warn"), but actually evaluate package suffers from this: r-lib/evaluate#81 (comment)

I believe this PR will fix the problem, but I'm not fully sure there's no downside... Should this be treated as a known issue?

@yutannihilation yutannihilation changed the title [WIP] Do not handle warnings when options("warn") >= 2 Do not handle warnings when options("warn") >= 2 Feb 24, 2018
@jimhester jimhester merged commit 5ed0bb1 into r-lib:master Mar 30, 2018
@jimhester
Copy link
Member

Thanks! I think passing the warning on in this case makes sense, it also allows you set options(warn = 2) in your tests if you want warnings to fail the build ala #731, https://community.rstudio.com/t/fail-ci-on-warnings-in-tests/6187/9

@yutannihilation yutannihilation deleted the option-warn-lt-2 branch March 30, 2018 20:57
@yutannihilation
Copy link
Contributor Author

Oh, I didn't come up with the usage. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants