-
Notifications
You must be signed in to change notification settings - Fork 185
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
Move requireNamespace() check for cyclocomp_linter() to the factory? #2777
Comments
What about adding cyclocomp as a dev dependency? It's in our lint config anyway, no? |
Yes, it's there. The issue is the |
Oh, I see. In that case I'm fine with skip_if_not_installed. |
One last wrinkle -- it's not so simple as just I still think it's the right thing to do but the diff will be bigger.
As in, make sure that we don't accidentally let it start just getting skipped everywhere in CI, right? I think the default |
Yes, basically assert 100% test code execution for some environment. One (probably very bad) idea: Define test_canary <- function(x) {
x
} and abuse code coverage statistics via skip_if_not_installed("cyclocomp")
expect_equal(test_canary(42L), 42L) |
Won't the existing codecov suite be enough? We'll get coverage there past any existing |
Here are the other 3 linters in our suite using lintr/R/literal_coercion_linter.R Line 80 in 22ee8db
lintr/R/object_overwrite_linter.R Lines 58 to 62 in 22ee8db
lintr/R/unused_import_linter.R Line 98 in 22ee8db
That makes
|
You're right, we would lose substantial code coverage if the codecov run would start skipping object_usage_linter. Therefor, it should be safe to guard all usages for R-CMD-check-hard. |
Currently, the validity check for
cyclocomp_linter()
happens inside the lint loop:lintr/R/cyclocomp_linter.R
Lines 25 to 33 in e673ee3
I think it makes more sense to do so outside the loop, but simply moving it breaks many things in our test suite when {cyclocomp} is not available.
Here's one test in particular that gives me pause:
lintr/tests/testthat/test-linter_tags.R
Lines 55 to 74 in e673ee3
Are we OK with just doing
skip_if_not_installed('cyclocomp')
here? Should we keep therequireNamespace()
check where it is?The text was updated successfully, but these errors were encountered: