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

Supply expect_lint_free expectation #30

Closed
hadley opened this issue Jan 9, 2015 · 1 comment
Closed

Supply expect_lint_free expectation #30

hadley opened this issue Jan 9, 2015 · 1 comment
Labels
feature a feature request or enhancement

Comments

@hadley
Copy link
Member

hadley commented Jan 9, 2015

So you could automatically add to you unit tests

@jimhester
Copy link
Member

Do you have any thoughts on the best way for this function to report failure? Maybe just print the lints object first and say it failed? Example implementation.

expect_lint_free <- function(...) {
  lints <- lint_package(...)
  has_lints <- length(lints) > 0
  if (has_lints) {
    print(lints)
  }
  expectation(!has_lints, "not lint free", "lint free")
}

Only issue I see with this approach is maybe it wouldn't work well with some of the Non-default testthat reporters, but admittedly I don't have much experience using them.

@jimhester jimhester added feature a feature request or enhancement and removed enhancement labels May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants