guangchuangyu / badger Goto Github PK
View Code? Open in Web Editor NEWBadge for R Package
Home Page: https://cran.r-project.org/package=badger
Badge for R Package
Home Page: https://cran.r-project.org/package=badger
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.
I was curious about why part of the code below is commented out:
Lines 56 to 77 in 01b6f5a
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).
👋🏽 I maintain the cran checks badges. Please change to the new cran checks badge URL (e.g., https://badges.cranchecks.info/worst/dplyr.svg
). Old badges at (e.g. https://cranchecks.info/badges/worst/dplyr
) will be unavailable as of Jan 1st 2023.
URL packages usually combines github.com and github.io urls like for this one: https://github.com/cran/ropenblas/blob/dd74d5b3f23a57c63a3b2520d3dc81f1f9554bdf/DESCRIPTION#L15
In that case, the URL returned by currentGitHubRef
is wrong:
> badger::badge_devel(color = "blue")
[1] "[![](https://img.shields.io/badge/devel%20version-0.2.6-blue.svg)](https://github.com/https://ddorch.github.io/Rthingsboard/)"
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:
usethis
Both solutions could retain "master" as a default in order to avoid breaking changes.
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:
use_coverage(type ="codecov")
test-coverage
using usethis::use_github_action("test-coverage")
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!
Hello,
Message when installing:
"Warning in install.packages :
package ‘badger’ is not available (for R version 3.6.1)"
I really like the idea of this package and would like to contribute a couple of new badges. Are you, @GuangchuangYu, willing to review a PR for the following badges?
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
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
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:
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
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.
I'm working on a local package in my workplace and I want to add relevant badges, specifically the one that displays the code coverage.
Is there a way to do that without the connection Codecov?
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).
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.
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. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.