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

@yutannihilation yutannihilation commented Feb 24, 2018

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
1 check was pending
Loading
@jimhester
Copy link
Member

@jimhester jimhester commented Mar 30, 2018

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

Loading

@yutannihilation yutannihilation deleted the option-warn-lt-2 branch Mar 30, 2018
@yutannihilation
Copy link
Contributor Author

@yutannihilation yutannihilation commented Mar 30, 2018

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

Loading

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

Successfully merging this pull request may close these issues.

None yet

2 participants