diff --git a/DESCRIPTION b/DESCRIPTION index b9095f0a1..b271a9f93 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -106,6 +106,7 @@ Collate: 'lint.R' 'linter_tag_docs.R' 'linter_tags.R' + 'lintr-package.R' 'literal_coercion_linter.R' 'make_linter_from_regex.R' 'methods.R' diff --git a/R/aaa.R b/R/aaa.R index 1e41ca672..4d197b95f 100644 --- a/R/aaa.R +++ b/R/aaa.R @@ -1,12 +1,4 @@ -#' @import rex -#' @importFrom utils tail #' @include utils.R -#' @rawNamespace -#' if (getRversion() >= "4.0.0") { -#' importFrom(tools, R_user_dir) -#' } else { -#' importFrom(backports, R_user_dir) -#' } NULL #' Available linters diff --git a/R/commas_linter.R b/R/commas_linter.R index 28299d485..24b0f2128 100644 --- a/R/commas_linter.R +++ b/R/commas_linter.R @@ -6,7 +6,6 @@ #' @seealso #' [linters] for a complete list of linters available in lintr. \cr #' -#' @importFrom utils head #' @export commas_linter <- function() { # conditions are in carefully-chosen order for performance -- diff --git a/R/cyclocomp_linter.R b/R/cyclocomp_linter.R index 490650a36..78e647fca 100644 --- a/R/cyclocomp_linter.R +++ b/R/cyclocomp_linter.R @@ -6,7 +6,6 @@ #' than this are linted. See [cyclocomp::cyclocomp()]. #' @evalRd rd_tags("cyclocomp_linter") #' @seealso [linters] for a complete list of linters available in lintr. -#' @importFrom cyclocomp cyclocomp #' @export cyclocomp_linter <- function(complexity_limit = 15L) { Linter(function(source_expression) { diff --git a/R/lint.R b/R/lint.R index e95fcd05d..9fee4c275 100644 --- a/R/lint.R +++ b/R/lint.R @@ -1,13 +1,3 @@ -#' Lintr -#' -#' Checks adherence to a given style, syntax errors and possible semantic issues. -#' Supports on the fly checking of R code edited with Emacs, Vim and Sublime Text. -#' @seealso [lint()], [lint_package()], [lint_dir()], [linters] -#' @importFrom stats na.omit -#' @importFrom utils capture.output getParseData relist -#' @keywords internal -"_PACKAGE" - #' Lint a file, directory, or package #' #' * `lint()` lints a single file. diff --git a/R/lintr-package.R b/R/lintr-package.R new file mode 100644 index 000000000..c0d4e2499 --- /dev/null +++ b/R/lintr-package.R @@ -0,0 +1,24 @@ +#' Lintr +#' +#' Checks adherence to a given style, syntax errors, and possible semantic issues. +#' Supports on the fly checking of R code edited with Emacs, Vim, and Sublime Text. +#' +#' @seealso [lint()], [lint_package()], [lint_dir()], [linters] +#' @keywords internal +"_PACKAGE" + +## lintr namespace: start +#' @import rex +#' @importFrom stats na.omit +#' @importFrom utils capture.output head getParseData relist +#' @importFrom xml2 xml_find_all as_list +#' @importFrom cyclocomp cyclocomp +#' @importFrom utils tail +#' @rawNamespace +#' if (getRversion() >= "4.0.0") { +#' importFrom(tools, R_user_dir) +#' } else { +#' importFrom(backports, R_user_dir) +#' } +## lintr namespace: end +NULL diff --git a/R/pipe_continuation_linter.R b/R/pipe_continuation_linter.R index 14e2f490f..a037b4774 100644 --- a/R/pipe_continuation_linter.R +++ b/R/pipe_continuation_linter.R @@ -6,7 +6,6 @@ #' @seealso #' [linters] for a complete list of linters available in lintr. \cr #' -#' @importFrom xml2 xml_find_all as_list #' @export pipe_continuation_linter <- function() { # For pipelines, either the whole expression should fit on a single line, or, diff --git a/man/lintr-package.Rd b/man/lintr-package.Rd index 29c36a043..a88a8b4dc 100644 --- a/man/lintr-package.Rd +++ b/man/lintr-package.Rd @@ -1,13 +1,13 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/lint.R +% Please edit documentation in R/lintr-package.R \docType{package} \name{lintr-package} \alias{lintr} \alias{lintr-package} \title{Lintr} \description{ -Checks adherence to a given style, syntax errors and possible semantic issues. -Supports on the fly checking of R code edited with Emacs, Vim and Sublime Text. +Checks adherence to a given style, syntax errors, and possible semantic issues. +Supports on the fly checking of R code edited with Emacs, Vim, and Sublime Text. } \seealso{ \code{\link[=lint]{lint()}}, \code{\link[=lint_package]{lint_package()}}, \code{\link[=lint_dir]{lint_dir()}}, \link{linters}