Skip to content

Commit

Permalink
Get rid of quotes, I guess???
Browse files Browse the repository at this point in the history
closes #2093

I can't easily find a more elegant solution
  • Loading branch information
jennybc committed Jan 23, 2025
1 parent 8d3979c commit bcb706d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions vignettes/articles/pr-functions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ div.output pre { background-color:#FFFFFF; background-image: none; }

## Contributing to someone else's package

So, you want to contribute to an R package? That's fantastic!
So, you want to contribute to an R package? That's fantastic!

Here we walk through the process of making a so-called **pull request** to the [praise](https://github.com/rladies/praise) package. This package is designed to help package developers "build friendly R packages that praise their users if they have done something good, or they just need it to feel better." You can use praise to construct encouraging feedback by sampling from its collection of positive adjectives, adverbs, verbs, smileys, and exclamations:

Expand Down Expand Up @@ -136,20 +136,20 @@ This creates a local branch called `formidable` and we switch to it (or "check i
Let's go ahead and make the change, which is adding the word "formidable" to the `R/adjective.R` file in the package. Below is the diff and the commit associated with this change.

```{r, echo = FALSE}
#| fig-alt: Screenshot of the RStudio Git pane showing the file
#| fig-alt: Screenshot of the RStudio Git pane showing the file
#| R/adjective.R staged for a commit. The preview of the file
#| highlights the addition of the line "formidabel", with no comma
#| at the end of the line. The Commit message says
#| "Add 'formidable' to adjectives".
#| highlights the addition of the line formidabel, with no comma
#| at the end of the line. The Commit message says
#| Add formidable to adjectives.
knitr::include_graphics("img/pr-functions-diff.png", dpi = 300)
```

You might spot that we made two mistakes here:

1. We intended to add "formidable", but added "formidabel" instead.
2. We forgot a comma at the end of the line.
Let's assume we didn't actually catch these mistakes, and didn't build and check
2. We forgot a comma at the end of the line.

Let's assume we didn't actually catch these mistakes, and didn't build and check
the package, which would have revealed the missing comma. We all make mistakes.

## Submit pull request
Expand All @@ -168,20 +168,20 @@ pr_push()
```
</div>

This launches a browser window at the URL specified in the last message, which
This launches a browser window at the URL specified in the last message, which
looks like the following.

<!-- in local preview, I Jenny am seeing a very wide image here -->

```{r, echo = FALSE}
#| fig-alt: A screenshot showing the diff on GitHub, with the old
#| version of the file on the left, and the new version
#| containing the newly added line 'formidabel', with no comma,
#| on the right. There is a green button that says "Create Pull Request".
#| fig-alt: A screenshot showing the diff on GitHub, with the old
#| version of the file on the left, and the new version
#| containing the newly added line formidabel, with no comma,
#| on the right. There is a green button that says Create Pull Request.
knitr::include_graphics("img/pr-functions-pull-request.png", dpi = 300)
```

Click "Create pull request" to make the PR. After clicking you will be able to choose between [draft PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests) and actual PR (If opening a draft PR, [mark it as ready for review](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request) once you're done, e.g. after a few more commits and one new call to `pr_push()`).
Click "Create pull request" to make the PR. After clicking you will be able to choose between [draft PR](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests#draft-pull-requests) and actual PR (If opening a draft PR, [mark it as ready for review](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/changing-the-stage-of-a-pull-request) once you're done, e.g. after a few more commits and one new call to `pr_push()`).

GitHub will ping the package maintainer and they will review our pull request. We can view this pull request in the browser with `pr_view()`. And anyone can follow along with this PR [rladies/praise#90](https://github.com/rladies/praise/pull/90).

Expand All @@ -199,19 +199,19 @@ pr_view(90)
If we're lucky, and our pull request is perfect, the maintainer will accept it, a.k.a. merge it. However, in this case, the PR still needs some work. So the package maintainer leaves us comments requesting changes.

```{r, echo = FALSE}
#| fig-alt: A screenshot of the comments section on the pull request.
#| A comment from a collaborator on the new line says "Did
#| you mean to add 'formidable'? And can you please add a comma
#| at the end? Thanks!"
#| fig-alt: A screenshot of the comments section on the pull request.
#| A comment from a collaborator on the new line says Did
#| you mean to add formidable? And can you please add a comma
#| at the end? Thanks!
knitr::include_graphics("img/pr-functions-comments.png", dpi = 300)
```

Being somewhat new to all this, we try to address one of these comments (fix spelling) and neglect the other (forget to add the comma). We make another change and commit it.

```{r, echo = FALSE}
#| fig-alt: A screenshot of the Rstudio Git pane, showing the changed line
#| with "formidabel" changed to "formidable". The file R/adjective.R
#| is staged for a commit, with the commit message "Fix Spelling!"
#| fig-alt: A screenshot of the Rstudio Git pane, showing the changed line
#| with formidabel changed to formidable. The file R/adjective.R
#| is staged for a commit, with the commit message Fix Spelling!
knitr::include_graphics("img/pr-functions-address-comments.png", dpi = 300)
```

Expand Down

0 comments on commit bcb706d

Please sign in to comment.