Skip to content
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

Limit assess_size_codebase to only .R files #363

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type: Package
Title: Risk Metrics to Evaluating R Packages
Description: Facilities for assessing R packages against a number of metrics to
help quantify their robustness.
Version: 0.2.4.9000
Version: 0.2.4.9001
Authors@R: c(
person("R Validation Hub", role = c("aut"), email = "[email protected]"),
person("Doug", "Kelkhoff", role = c("aut"), email = "[email protected]"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# riskmetric (development version)

- Fix bug with assessing source packages that have non-R files in the R directory ([#362](https://github.com/pharmaR/riskmetric/issues/362))

# riskmetric 0.2.4

- Fix CRAN errors.
Expand Down
7 changes: 6 additions & 1 deletion R/assess_size_codebase.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ assess_size_codebase.pkg_install <- function(x, ...) {
assess_size_codebase.pkg_source <- function(x, ...) {
pkg_metric_eval(class = "pkg_metric_size_codebase", {
# create character vector of function files
files <- list.files(path = file.path(x$path, "R"), full.names = T)
files <- list.files(
path = file.path(x$path, "R"),
pattern = "\\.R$",
full.names = TRUE,
ignore.case = TRUE
)

# define the function for counting code base
count_lines <- function(x){
Expand Down
Loading