% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/expect_true_false_linter.R
\name{expect_true_false_linter}
\alias{expect_true_false_linter}
\title{Require usage of \code{expect_true(x)} over \code{expect_equal(x, TRUE)}}
\usage{
expect_true_false_linter()
}
\description{
\code{\link[testthat:expect_true]{testthat::expect_true()}} and \code{\link[testthat:expect_false]{testthat::expect_false()}} exist specifically
for testing the \code{TRUE}/\code{FALSE} value of an object.
\code{\link[testthat:expect_equal]{testthat::expect_equal()}} and \code{\link[testthat:expect_identical]{testthat::expect_identical()}} can also be
used for such tests, but it is better to use the tailored function instead.
}
\examples{
# will produce lints
lint(
  text = "expect_equal(x, TRUE)",
  linters = expect_true_false_linter()
)

lint(
  text = "expect_equal(x, FALSE)",
  linters = expect_true_false_linter()
)

# okay
lint(
  text = "expect_true(x)",
  linters = expect_true_false_linter()
)

lint(
  text = "expect_false(x)",
  linters = expect_true_false_linter()
)

}
\seealso{
\link{linters} for a complete list of linters available in lintr.
}
\section{Tags}{
\link[=best_practices_linters]{best_practices}, \link[=package_development_linters]{package_development}, \link[=pkg_testthat_linters]{pkg_testthat}, \link[=readability_linters]{readability}
}
