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

ignore incomplete final line #317

Merged
merged 1 commit into from
Oct 27, 2023
Merged

ignore incomplete final line #317

merged 1 commit into from
Oct 27, 2023

Conversation

paulie-of-punskas
Copy link
Collaborator

Warning message is returned, when running "assess_has_news" on packages, that do not have empty line at the end of file:

image

I have tested it on packages "ini", "viridisLite". Below is the code for reproducing the warning messages.

# === load riskmetric library
library("riskmetric")
library("magrittr")

# === create testing environment
dir.create(paste0(tempdir(), "/test_riskmetric"))
dir.create(paste0(tempdir(), "/test_riskmetric/source"))
dir.create(paste0(tempdir(), "/test_riskmetric/library"))
dir.create(paste0(tempdir(), "/test_riskmetric/downloads"))

# === download and unpack files
pkgs <- c("viridisLite", "ini")

# === install packages
install.packages(pkgs, lib = paste0(tempdir(), "/test_riskmetric/library"))
list.files(paste0(tempdir(), "/test_riskmetric/library"), recursive = TRUE)

pkg_ref(x = paste0(tempdir(), "/test_riskmetric/library/", pkgs[1])) %>% 
  pkg_assess(assessments = riskmetric::all_assessments()["assess_has_news"]) %>% 
  pkg_score()

pkg_ref(x = paste0(tempdir(), "/test_riskmetric/library/", pkgs[2])) %>% 
  pkg_assess(assessments = riskmetric::all_assessments()["assess_has_news"]) %>% 
  pkg_score()

Simplest fix, would be to to use readLines(., warn = FALSE).

@paulie-of-punskas paulie-of-punskas requested review from emilliman5 and dgkf and removed request for dgkf October 9, 2023 19:19
@codecov-commenter
Copy link

Codecov Report

Merging #317 (2d197a8) into master (31854ae) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 2d197a8 differs from pull request most recent head 30f3f5e. Consider uploading reports for the commit 30f3f5e to get more accurate results

@@           Coverage Diff           @@
##           master     #317   +/-   ##
=======================================
  Coverage   61.85%   61.85%           
=======================================
  Files          66       66           
  Lines        1025     1025           
=======================================
  Hits          634      634           
  Misses        391      391           
Files Coverage Δ
R/pkg_ref_cache_news.R 76.92% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@emilliman5 emilliman5 merged commit 3905c66 into master Oct 27, 2023
11 checks passed
@emilliman5 emilliman5 deleted the ignore_EOL branch October 27, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants