Code Monkey home page Code Monkey logo

badger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

badger's Issues

`badge_github_version`: change `pkg` arg to `ref`

Hi again,

This is a minor thing, but I found it about confusing until I looked into the code.

badge_github_version take the argument pkg:

pkg | package. If NULL (the default) the package is determined via the DESCRIPTION file.

but I think it actually means something closer to ref, as implemented in functions like badger::badge_github_actions:

## produces wrong link
badger::badge_github_version(pkg="rworkflows")

## produces correct link
badger::badge_github_version(pkg="neurogenomics/rworkflows")

If you agree, should be a simple fix to change the arg name to ref, and update the argument description accordingly.

Question about commented-out code

I was curious about why part of the code below is commented out:

badger/R/badge.R

Lines 56 to 77 in 01b6f5a

ver_devel <- function (pkg = NULL) {
## flag <- FALSE
## if (file.exists("DESCRIPTION")) {
## x <- readLines("DESCRIPTION")
## flag <- TRUE
## } else if (file.exists("../DESCRIPTION")) {
## x <- readLines("../DESCRIPTION")
## flag <- TRUE
## }
## if (flag) {
## y <- x[grep("^Version", x)]
## v <- sub("Version: ", "", y)
## if ((as.numeric(gsub("\\d+\\.(\\d+)\\.\\d+", "\\1", v))%%2) == 1) {
## return(v)
## }
## }
pkg <- currentGitHubRef(pkg)
ver <- tryCatch(desc::desc_get_field("Version"), error = function(e) NULL)
if (is.null(ver ))
ver <- check_github(pkg)$latest_version
return(ver)
}

It looks like an attempt to read the package version from a local DESCRIPTION, which sounds to me like a useful feature (instead of having the function always try to retrieve it from GitHub).

Add support for default git branch names other than "master"

Currently, several badger functions are built with the assumption that the default git branch name is "master (badge_last_commit(), badge_travis(), badge_coveralls(), and badge_codecov()).

Recent updates to git allow users to choose a different default branch name for their projects, and a number of R packages have made adjustments to accommodate this. Of particular interest, the 2.0.0 release of usethis will export a function to detect a user's default git branch (git_branch_default()).

Would you be interested in a PR to add support for other default branch names? I could implement this in two ways:

  • A new argument in these functions that would allow users to manually specify a default branch name
  • Automatic default branch detection, which would require less user intervention but add a dependency on usethis

Both solutions could retain "master" as a default in order to avoid breaking changes.

broken link with badger::badge_codecov() - lack codecov token?

Hi @GuangchuangYu! Firstly, thank you for making such a convenient package! I use it regularly for package devs!

I am trying to establish a workflow for setting up:

  • codecov for a simple, public R package using use_coverage(type ="codecov")
  • GitHub Actions CI workflow test-coverage using usethis::use_github_action("test-coverage")
  • a badge for code coverage using badger::badge_codecov(branch="gha")

Unfortunately when I use the output for badger::badge_codecov(branch="gha") e.g. d9e2987 in the README, the badge"shows "unknown: Knitting locally shows the same thing. However navigating to: https://codecov.io/gh/fontikar/ohwhaley/branch/gha/graph/badge.svg, gives me a perfect 100% badge.

I then tried using the codecov badge found in the settings section of the repo which contains my codecov token https://codecov.io/gh/fontikar/ohwhaley/branch/gha/graph/badge.svg?token=XXXXXXXX and it was successful e.g. 701020d

Am I missing a step? I tried adding the codecov token in my codecov.yaml but that didn't work either e.g. 7cd93db

Your advice would be greatly appreciated!

badger not in CRAN

Hello,
Message when installing:
"Warning in install.packages :
package ‘badger’ is not available (for R version 3.6.1)"

codecov domain name update

hi @GuangchuangYu ,

I noticed recently that when when running R CMD check with the --as-cran flag, it gives a warning that the code cov URL has been changed slightly. This comes up because I have badger::badge_codecov() in my README.Rmd file.

In the case of my package MAGMA_Celltyping, this shows up as:

 URL: https://codecov.io/gh/neurogenomics/MAGMA_Celltyping (moved to https://app.codecov.io/gh/neurogenomics/MAGMA_Celltyping)
    From: README.md
    Status: 200
    Message: OK

The old URL forwards to the new one just fine, but for the sake of CRAN checks would it be possible to use the new domain name in badger::badge_codecov()?

Many thanks,
Brian

`Error: Default branch mismatch between local repo and remote.` persists

Hello,

I use badger extensively in all my packages now and they look awesome (and informative)! We're trying to include badges in the README of our package MungeSumstats.

Unfortunately, as of a couple weeks ago i noticed on GH Actions that when I try to knit .Rmd files, badger gives this error:
https://github.com/neurogenomics/MungeSumstats/runs/4508279435?check_suite_focus=true

Screenshot 2021-12-13 at 16 07 57

In other packages where I encountered this message, I ran the recommended solution and it worked like a charm:

usethis:: git_default_branch_rediscover()

However, I've run this several times with MungeSumstats on my local machine, and now when I run this it just says:

Screenshot 2021-12-13 at 16 13 35

Yet the same issue persists when i push to GH.

I should note that I'm pushing to our "bschilder_dev" branch, but the default branch is indeed "master".

Do you have an idea of what might be going on here?

Many thanks in advance,
Brian

Tagging the codevs @Al-Murphy @NathanSkene

Version 0.2.0 + CRAN release?

Considering the new feature brought by PR #37, I was wondering if a bump to version 0.2.0 and a CRAN release are under consideration. I've been using badge_repostatus() a lot, and having this available on CRAN instead of GitHub only would ease and potentially increase use of this tool and standard.

badge_github_version not dynamic?

It seems that badger::badge_github_version generates a static badge that fails to update. e.g.

badger::badge_github_version(pkg='MurrayEfford/secr', 'blue')
[1] ""

What am I missing?

Add unit tests

This package doesn't seem to contain a testing framework, so new code contributions are at risk of inadvertently breaking something. I, for one, really enjoy using the testthat package for that. If I have some spare time in the near future, I could help you set this up (or improve it, if someone else gets around to it faster).

badge_cran missing

In the readme, badge_cran is given as an example to link back to CRAN. R complains that it's not an exported function, but I noticed that badge_cran_release is.

Add CI workflow

Having a Continuous Integration worflow would help make sure the package is always ready to release and adequately working on different platforms and R versions. I use GitHub Actions for my current projects, so there's my recommendation. :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.