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

Add explicit check that each contributed file has exactly 1 line #18

Merged
merged 2 commits into from
Mar 13, 2024
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
@@ -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