sandpaper icon indicating copy to clipboard operation
sandpaper copied to clipboard

Missing trailing newline at the end of files causes warning

Open apirogov opened this issue 2 years ago • 1 comments

Currently, if you do not have an empty line at the end of a file, it produces warnings such as:

Warnmeldungen:
1: In readLines(path, encoding = encoding) :
  unvollständige letzte Zeile in '/local/home/a.pirogov/projects/ias9/scientific-metadata/instructors/instructor-notes.md' gefunden
2: In readLines(path, encoding = encoding) :
  unvollständige letzte Zeile in '/local/home/a.pirogov/projects/ias9/scientific-metadata/instructors/meet-the-creators.Rmd' gefunden
3: In readLines(path, encoding = encoding) :
  unvollständige letzte Zeile in '/local/home/a.pirogov/projects/ias9/scientific-metadata/learners/meet-the-creators.Rmd' gefunden

(it says "incomplete last line" in some file....)

I don't think that not having an empty line at the end of files should be something triggering a warning.

Using sandpaper (0.12.4), pegboard (0.5.3), and varnish (0.2.18).

apirogov avatar Aug 29 '23 11:08 apirogov

Thank you for the report. This is the default behaviour of R's readLines() function: https://stat.ethz.ch/R-manual/R-devel/library/base/html/readLines.html

There are many places this can occur within {sandpaper} (possibly in {pegboard} or {tinkr}). I will see if I can track it down and provide warn = FALSE in those functions when I have time.

That being said, I'm hesitant to label it as a bug because a warning doesn't impede the functionality of The Workbench.

zkamvar avatar Aug 29 '23 17:08 zkamvar