-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Work on use_github_labels() #249
Conversation
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."
R/github-labels.R
Outdated
#' | ||
#' @param delete_default If `TRUE`, will remove default labels. | ||
#' `gh_labels()` returns the labels and colours commonly used by tidyverse |
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.
Should this include tidy
since it's a tidyverse convention?
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.
gh_labels()
--> tidy_labels()
in 7d7a544
R/github-labels.R
Outdated
#' 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 |
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.
unless explicitly requested with remove = TRUE
?
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.
Reworded to be mention delete_default = TRUE
R/github-labels.R
Outdated
#' use_github_labels(delete_default = TRUE) | ||
#' } | ||
use_github_labels <- function(labels = gh_labels(), | ||
delete_default = FALSE, |
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.
Should this be remove = FALSE
?
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.
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.
R/github-labels.R
Outdated
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))) |
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.
default -> other ?
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.
Now reads "Removing labels", which should stand the test of time.
R/github-labels.R
Outdated
) | ||
#' @rdname use_github_labels | ||
#' @export | ||
gh_labels <- function() { |
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.
I don't love the current colours, but I find the new colours ugly 😞
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.
I reverted the changes to existing colours.
Would the docs for this function be a good place to park out descriptions of when to use the different labels? |
Darker shade of 6c71c4, the violet from Solarized. Made darker in order to force text to become white.
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 Can I merge? It's easy to tweak colours in future. |
gh_labels()
tidy_labels()
which returns named vector of in-house standard labels and colourslabels
argument, in case anyone wants something other thangh_labels()
tidy_labels()
Adopt GitHub default colours for "bug" (just a different red) and "feature" (the light blue they use for "enhancement")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