-
Notifications
You must be signed in to change notification settings - Fork 1k
ensure that DCF does not have empty line at the end before appending … #5508
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
Conversation
…to it, as that would result in build failure
…at the bottom while all other fields are easy to see straight away at the top
Codecov Report
@@ Coverage Diff @@
## master #5508 +/- ##
=======================================
Coverage 99.51% 99.51%
=======================================
Files 80 80
Lines 14774 14774
=======================================
Hits 14702 14702
Misses 72 72 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
.gitlab-ci.yml
Outdated
| before_script: | ||
| - Rscript -e 'install.packages(c("knitr","rmarkdown"), repos=file.path("file:",normalizePath("bus/mirror-packages/cran")), quiet=TRUE)' | ||
| - rm -r bus | ||
| - sed -i '${/^$/d;}' ./DESCRIPTION ## remove last empty line in DCF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An "empty line" to me means \n\n at the end. Just having a \n at the end of the last line is just a normal line ending, not an empty line being creating.
So, to be absolutely clear, suggest comment be :
make last line end abruptly; i.e. without a final \n
Further, I tested it, and if the file ends with \n[ ]+ then the last empty line is not removed.
And if there are 2 or more \n at the end, only 1 is removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further, I tested it, and if the file ends with \n[ ]+ then the last empty line is not removed.
And if there are 2 or more \n at the end, only 1 is removed.
I think those two are clear issues that we should not auto-fix in CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R CMD build has no problem with spaces or newlines at the end so why do you view these as an issue at all, let alone a clear issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they serve no purpose. Last new line has no purpose as well, but it is easier to be added during editing DCF. Although now, after your change of closing brackets of authors being in the last line, I think we could skip sed in my PR altogether, as the last line will not have to be edited anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they serve no purpose is a reason not to let them get in the way again in future. That is the goal here: to prevent the same problem happening again. The GLCI script is the one applying the >> operation to DESCRIPTION, so that is what should prepare for that operation the best it can. It's that simple. So that we don't have the same problem again in future.
I will change it to do what I asked, merge and move on.
…the same GLCI failure again
…to it, as that would result in build failure
follow up of comments in 9acf6d9#comments