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

Work on use_github_labels() #249

Merged
merged 9 commits into from Feb 14, 2018

Conversation

Projects
None yet
2 participants
@jennybc
Copy link
Member

jennybc commented Feb 14, 2018

  • Export gh_labels() tidy_labels() which returns named vector of in-house standard labels and colours
  • Add labels argument, in case anyone wants something other than gh_labels() tidy_labels()
  • Fix buglet that prevented modification of exactly 1 colour + handle a length-0 edge case
  • Add "good first issue" and "help wanted", with GitHub default colours (now tweaked)
  • Adopt GitHub default colours for "bug" (just a different red) and "feature" (the light blue they use for "enhancement")
  • Beefed up the docs
  • Styled with styler

This repo has had this version of use_github_labels() called on it, so here's the effect:
https://github.com/r-lib/usethis/labels

jennybc added some commits Feb 13, 2018

Add "good first issue" and "help wanted"; update colors
Closes #168

More about color changes inspired by the official GitHub colors:

  * Switched to their red for "bug"
  * Our "feature" now uses GitHub's color for "enhancement"

https://twitter.com/github/status/954467266434945024

"Parts of GitHub might look a little different today. We've changed the text color for issue labels to meet accessibility standards based on WCAG guidelines."

@jennybc jennybc requested a review from hadley Feb 14, 2018

#'
#' @param delete_default If `TRUE`, will remove default labels.
#' `gh_labels()` returns the labels and colours commonly used by tidyverse

This comment has been minimized.

@hadley

hadley Feb 14, 2018

Member

Should this include tidy since it's a tidyverse convention?

This comment has been minimized.

@jennybc

jennybc Feb 14, 2018

Author Member

gh_labels() --> tidy_labels() in 7d7a544

#' It does not generally remove labels, unless you explicit ask to
#' remove GitHub's defaults.
#' @description `use_github_labels()` creates new labels and/or changes label
#' colours. It does not generally remove labels, unless you explicitly ask to

This comment has been minimized.

@hadley

hadley Feb 14, 2018

Member

unless explicitly requested with remove = TRUE?

This comment has been minimized.

@jennybc

jennybc Feb 14, 2018

Author Member

Reworded to be mention delete_default = TRUE

#' use_github_labels(delete_default = TRUE)
#' }
use_github_labels <- function(labels = gh_labels(),
delete_default = FALSE,

This comment has been minimized.

@hadley

hadley Feb 14, 2018

Member

Should this be remove = FALSE?

This comment has been minimized.

@jennybc

jennybc Feb 14, 2018

Author Member

Are you suggesting that remove = TRUE requests to drop labels that are not present in labels, regardless of whether they are GitHub defaults?

Based on my interactions with usethis labels while working on this, that would create more work. For example, pretty sure I would have accidentally deleted the non-package label by now.

def_labels <- setdiff(cur_labels[default], names(gh_labels))
if (delete_default && length(cur_labels) > 0) {
default <- vapply(cur_labels, "[[", "default", FUN.VALUE = logical(1))
def_labels <- setdiff(cur_label_names[default], names(labels))

if (length(def_labels) > 0) {
done("Removing default labels: ", collapse(value(def_labels)))

This comment has been minimized.

@hadley

hadley Feb 14, 2018

Member

default -> other ?

This comment has been minimized.

@jennybc

jennybc Feb 14, 2018

Author Member

Now reads "Removing labels", which should stand the test of time.

)
#' @rdname use_github_labels
#' @export
gh_labels <- function() {

This comment has been minimized.

@hadley

hadley Feb 14, 2018

Member

I don't love the current colours, but I find the new colours ugly 😞

This comment has been minimized.

@jennybc

jennybc Feb 14, 2018

Author Member

I reverted the changes to existing colours.

@hadley

This comment has been minimized.

Copy link
Member

hadley commented Feb 14, 2018

Would the docs for this function be a good place to park out descriptions of when to use the different labels?

jennybc added some commits Feb 14, 2018

New violet for "good first issue"
Darker shade of 6c71c4, the violet from Solarized. Made darker in order to force text to become white.
ws

@jennybc jennybc referenced this pull request Feb 14, 2018

Closed

Document `tidy_labels()` #252

@jennybc

This comment has been minimized.

Copy link
Member Author

jennybc commented Feb 14, 2018

Would the docs for this function be a good place to park out descriptions of when to use the different labels?

Yes, I opened #252 for that. We could merge this in the meantime.

I reverted the color changes and picked a nicer violet for "good first issue".

This repo has had the proposed version of use_github_labels() called on it, so here's the effect:
https://github.com/r-lib/usethis/labels

Can I merge? It's easy to tweak colours in future.

@hadley

hadley approved these changes Feb 14, 2018

@jennybc jennybc merged commit 2d4479b into master Feb 14, 2018

5 of 6 checks passed

codecov/patch 0% of diff hit (target 62.46%)
Details
codecov/project 62.02% (-0.45%) compared to 4a9d0b0
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jennybc jennybc deleted the github-issue-labels branch Feb 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.