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

Update bump-version.R - replace length test in get_main_branch_config() #775

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

D3SL
Copy link

@D3SL D3SL commented May 19, 2024

Closes #767
length(table) always returns the number of columns, even for an empty (no rows) table. New test looks for the string "local" in init$level.

length(table) always returns the number of columns, even for an empty (no rows) table. New test looks for the string "local" in init$level.
Copy link
Contributor

aviator-app bot commented May 19, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This pull request is currently open (not queued).

How to merge

To merge this PR, comment /aviator merge or add the mergequeue label.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Copy link
Member

@maelle maelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!!

Can you edit your first GitHub comment in the PR to make it refer to the issue it's closing? See https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

R/bump-version.R Outdated
@@ -95,17 +95,17 @@ get_main_branch_remote <- function(remote, repo) {
basename(as.character(remotes$symref[remotes$ref == "HEAD"]))
}

get_main_branch_config <- function(repo) {
get_main_branch_config <- function(repo) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why change the indentation level?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, it wasn't intentional. Could be a whitespace character artefact or some hiccup with trying to paste code from my IDE into github's online editor. Is there a way to get rid of that without redoing the whole PR from scratch?

edit: I think I did it.

R/bump-version.R Outdated

if (length(local)) {
return(local$value)
#return local default branch if it exists, otherwise default to global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the comments can be removed as the code is clear enough: https://blog.r-hub.io/2023/01/26/code-comments-self-explaining-code/

Copy link
Author

@D3SL D3SL Jun 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're right. What would be more helpful is a comment explaining the purpose behind this internal function. It doesn't do much right now but this could be part of allowing for branch names other than "origin".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you! Can you remove the comments then? An alternative to adding a comment about the function would be to improve its name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I think I got it right this time. Github is almost as complicated as git itself.

D3SL added 2 commits June 5, 2024 12:12
fix indentation at line 98
removing comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

get_main_branch_config() reliance on length(tablename) fails with 0 row table
2 participants