diff --git a/NAMESPACE b/NAMESPACE index 2b25b2d5..99d592db 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,6 +1,7 @@ # Generated by roxygen2: do not edit by hand export(app) +export(box_func_import_count_linter) export(build_js) export(build_sass) export(diagnostics) diff --git a/man/box_func_import_count_linter.Rd b/man/box_func_import_count_linter.Rd new file mode 100644 index 00000000..1edf45b9 --- /dev/null +++ b/man/box_func_import_count_linter.Rd @@ -0,0 +1,38 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/linter_box_function_import_count_linter.R +\name{box_func_import_count_linter} +\alias{box_func_import_count_linter} +\title{Box library function import count linter} +\usage{ +box_func_import_count_linter(max = 5L) +} +\arguments{ +\item{max}{Maximum function imports allowed between \code{[} and \verb{]}. Defaults to 5.} +} +\description{ +Checks that function imports do not exceed the defined \code{max}. Defaults to 5. +} +\examples{ +# will produce lints +lintr::lint( + text = "box::use(package[one, two, three, four, five, six, ])", + linters = box_func_import_count_linter() +) + +lintr::lint( + text = "box::use(package[one, two, three, four, ])", + linters = box_func_import_count_linter(3) +) + +# okay +lintr::lint( + text = "box::use(package[one, two, three, four, five, ])", + linters = box_func_import_count_linter() +) + +lintr::lint( + text = "box::use(package[one, two, three, ])", + linters = box_func_import_count_linter(3) +) + +} diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 759c93d4..a69c5e4f 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -143,6 +143,10 @@ reference: - diagnostics - test_e2e +- title: Linters + contents: + - box_func_import_count_linter + - title: Data contents: - rhinos