Skip to content

Commit

Permalink
Merge pull request #18 from wlandau/line-check
Browse files Browse the repository at this point in the history
Add explicit check that each contributed file has exactly 1 line
  • Loading branch information
wlandau authored Mar 13, 2024
2 parents 7b504f7 + 3cc1d53 commit c686f0e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: r.releases.internals
Title: Internal Infrastructure for An R Universe of Package Releases
Description: Internal infrastructure for an R universe of package releases.
Version: 0.0.14
Version: 0.0.15
License: MIT + file LICENSE
URL: https://github.com/r-releases/r.releases.internals
BugReports: https://github.com/r-releases/r.releases.internals/issues
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# r.releases.internals 0.0.15

* Add explicit check that each contribution has only 1 line.

# r.releases.internals 0.0.14

* Allow terminating newline to be absent in URL contributions.
Expand Down
18 changes: 18 additions & 0 deletions R/review_pull_request.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ review_pull_request <- function(
return(invisible())
}
name <- basename(file$filename)
if (file$additions != 1L) {
pull_request_defer(
owner = owner,
repo = repo,
number = number,
message = paste(
"Text file",
shQuote(name),
"in pull request",
number,
"has",
file$additions,
"lines. The file must have exactly 1 line",
"unless it contains custom JSON (which is uncommon)."
)
)
return(invisible())
}
if (!is_character_scalar(file$patch)) {
pull_request_defer(
owner = owner,
Expand Down

0 comments on commit c686f0e

Please sign in to comment.