1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/expect_s4_class_linter.R
\name{expect_s4_class_linter}
\alias{expect_s4_class_linter}
\title{Require usage of \code{expect_s4_class(x, k)} over \code{expect_true(is(x, k))}}
\usage{
expect_s4_class_linter()
}
\description{
\code{\link[testthat:inheritance-expectations]{testthat::expect_s4_class()}} exists specifically for testing the class
of S4 objects. \code{\link[testthat:logical-expectations]{testthat::expect_true()}} can also be used for such tests,
but it is better to use the tailored function instead.
}
\examples{
# will produce lints
lint(
text = 'expect_true(is(x, "Matrix"))',
linters = expect_s4_class_linter()
)
# okay
lint(
text = 'expect_s4_class(x, "Matrix")',
linters = expect_s4_class_linter()
)
}
\seealso{
\itemize{
\item \link{linters} for a complete list of linters available in lintr.
\item \code{\link[=expect_s3_class_linter]{expect_s3_class_linter()}}
}
}
\section{Tags}{
\link[=best_practices_linters]{best_practices}, \link[=package_development_linters]{package_development}, \link[=pkg_testthat_linters]{pkg_testthat}
}
|