cloc_pkg: Count lines of code, comments and whitespace in a package

View source: R/cloc-pkg-src.R

cloc_pkgR Documentation

Count lines of code, comments and whitespace in a package

Description

Think of this as cloc() with saner defaults for packages. Skips common IDE tempdirs, .git, inst, man.

Usage

cloc_pkg(source = ".", extract_with = NULL)

Arguments

source

file, directory or archive to read from (can be a valid URL)

extract_with

passed into cloc command line. This option is only needed if cloc is unable to figure out how to extract the contents of the input file(s) by itself.

Value

data frame (tibble)

Examples

# by dir
cloc(system.file("extdata", package="cloc"))

# by file
cloc(system.file("extdata", "qrencoder.cpp", package="cloc"))

# requires a network connection therefore is set for you to run it manually
## Not run: 
# from a url
cloc("https://rud.is/dl/cloc-1.74.tar.gz")

## End(Not run)

hrbrmstr/cloc documentation built on May 1, 2023, 7:34 a.m.