-
Notifications
You must be signed in to change notification settings - Fork 184
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
Violation of least astonishment, asymmetry of behavior or lack of documentation in expect_lint_free() #407
Comments
If you want to submit a PR to update the documentation you are welcome, otherwise I am closing this issue as it is working as intended. |
I completely disagree. It's not working as intended and it should not be closed because it's an issue that must be resolved. Otherwise you would not ask for a PR. |
@stefanoborini My knowledge here is limited, but to my eye NOT_CRAN is a ~standard approach in the R testing world and therefore not astonishing: The maintainers of CRAN want your code to behave by default in a way that complies with CRAN policies, so needing to ask specially for the non-CRAN behavior is intended. (My understanding is that the "NOT_CRAN" convention arose because the CRAN maintainers have extended the 'should behave this way by default' idea into a principle of not providing any particular test your code can use to determine for sure that it is on CRAN -- i.e. there's no equivalent of Travis's |
@infotroph nothing in the name "expect_lint_free" function name or documentation hints at the possibility that this function will be a no-op unless some specific environment characteristics exist that are never mentioned anywhere in the documentation of the whole package or of the function itself. I expect a linter to lint my code. Not to lint my code if the planets align. |
Related to #406
By default and with no mention in the documentation the expect_lint_free function assume it's running on CRAN, unless told otherwise, and will say absolutely nothing about it:
In other words, its default assumes that you are CRAN, unless you specifically say otherwise. This is a least astonishment violation, an asymmetry in behavior between lint_package() and expect_lint_free(), and lack of documentation clarity.
This is mostly a testthat issue, as the default should be to check for a positive confirmation that you are on CRAN, not a negative one. It has, however, a direct influence on lintr behavior.
The text was updated successfully, but these errors were encountered: