boB Rudis
6 years ago
8 changed files with 70 additions and 44 deletions
@ -0,0 +1,31 @@ |
|||
#' Run [cloc_pkg()] on active package and format it as a markdown table for knitting into reports |
|||
#' |
|||
#' @md |
|||
#' @note Target application is output to Rmd files |
|||
#' @export |
|||
cloc_pkg_md <- function() { |
|||
|
|||
pkg_root <- rprojroot::find_package_root_file(path = ".") |
|||
|
|||
as.data.frame( |
|||
read.dcf(file.path(pkg_root, "DESCRIPTION")), |
|||
stringsAsFactors=FALSE |
|||
)$Package[1] -> pkg_name |
|||
|
|||
knitr::kable( |
|||
setNames( |
|||
cloc::cloc_pkg()[,-1], |
|||
c( |
|||
"Lang", |
|||
"# Files", "(%)", |
|||
"LoC", "(%)", |
|||
"Blank lines", "(%)", |
|||
"# Lines", "(%)" |
|||
) |
|||
), |
|||
format = "markdown", |
|||
digits = 2, |
|||
caption = sprintf("clock Package Metrics for %s", pkg_name) |
|||
) |
|||
|
|||
} |
@ -0,0 +1,14 @@ |
|||
% Generated by roxygen2: do not edit by hand |
|||
% Please edit documentation in R/clock-pkg-md.R |
|||
\name{cloc_pkg_md} |
|||
\alias{cloc_pkg_md} |
|||
\title{Run \code{\link[=cloc_pkg]{cloc_pkg()}} on active package and format it as a markdown table for knitting into reports} |
|||
\usage{ |
|||
cloc_pkg_md() |
|||
} |
|||
\description{ |
|||
Run \code{\link[=cloc_pkg]{cloc_pkg()}} on active package and format it as a markdown table for knitting into reports |
|||
} |
|||
\note{ |
|||
Target application is output to Rmd files |
|||
} |
Loading…
Reference in new issue