-
Notifications
You must be signed in to change notification settings - Fork 184
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
Attenuate the verbosity in lint_package() #260
Comments
I think all you would need was to define a summary.lints <- function(object, ...) {
filenames <- vapply(object, `[[`, character(1), "filename")
types <- factor(vapply(object, `[[`, character(1), "type"), levels = c("style", "warning", "error"))
tbl <- table(filenames, types)
filenames <- rownames(tbl)
res <- as.data.frame.matrix(tbl, stringsAsFactors = FALSE, row.names = FALSE)
res$filenames <- filenames
nms <- colnames(res)
res[order(-res$error, -res$warning, -res$style), c("filenames", nms[nms != "filenames"])]
}
head(n = 15,
summary(package_lints("devtools")))
#> filenames style warning error
#> 23 R/install-github.r 6 4 0
#> 26 R/install-svn.r 7 2 0
#> 12 R/doctor.R 5 2 0
#> 15 R/git.R 5 2 0
#> 32 R/release.r 7 1 0
#> 28 R/install-version.r 5 1 0
#> 45 R/zzz.r 3 1 0
#> 20 R/install-bitbucket.r 2 1 0
#> 10 R/decompress.r 1 1 0
#> 30 R/package.r 1 1 0
#> 25 R/install-remote.R 50 0 0
#> 50 tests/testthat/test-github.r 45 0 0
#> 47 tests/testthat/test-bioconductor.r 19 0 0
#> 11 R/deps.R 17 0 0
#> 54 tests/testthat/test-remotes.r 10 0 0 |
Thank you @jimhester, this is exactly what I am after. Could this function become part of |
Sure it could be, if you would like to open a PR with the above I can review it. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
lint_package()
, it would be nice to have an option to condense the output. Rather than print out every lint, sometimes I may want to print the number of lints per file and omit all the clean files. I am picturing something likeprint(covr::package_coverage())
.The text was updated successfully, but these errors were encountered: