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

pkg rename 'repometrics' for #19 #20

Merged
merged 7 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Contributing to `github`
# Contributing to `repometrics`

<!-- This CONTRIBUTING.md is adapted from https://gist.github.com/peterdesmet/e90a1b0dc17af6c12daf6e8b2f044e7c -->

First of all, thanks for considering contributing to `githist`! 👍 It's
First of all, thanks for considering contributing to `repometrics`! 👍 It's
people like you that make it rewarding for us - the project maintainers - to
work on `githist`. 😊
work on `repometrics`. 😊

`githist` is an open source project, maintained by people who care.
`repometrics` is an open source project, maintained by people who care.

- repo: https://github.com/ropensci-review-tools/githist
- issues: https://github.com/ropensci-review-tools/githist/issues
- new_issue: https://github.com/ropensci-review-tools/githist/issues/new
- website: https://docs.ropensci.org/githist/
- citation: https://ropensci-review-tools.github.io/githist/authors.html
- repo: https://github.com/ropensci-review-tools/repometrics
- issues: https://github.com/ropensci-review-tools/repometrics/issues
- new_issue: https://github.com/ropensci-review-tools/repometrics/issues/new
- website: https://docs.ropensci.org/repometrics/
- citation: https://ropensci-review-tools.github.io/repometrics/authors.html
- email: mailto:mark@ropensci.org

## Code of conduct
Expand All @@ -29,18 +29,18 @@ this [Open Source Guide](https://opensource.guide/how-to-contribute/).

### Share the love ❤️

Think `githist` is useful? Let others discover it, by telling them in person,
Think `repometrics` is useful? Let others discover it, by telling them in person,
via Twitter or a blog post.

Using `githist` for a paper you are writing? Consider [citing
it](https://github.com/ropensci-review-tools/githist/blob/main/inst/CITATION).
Using `repometrics` for a paper you are writing? Consider [citing
it](https://github.com/ropensci-review-tools/repometrics/blob/main/inst/CITATION).

### Ask a question ⁉️

Using `githist` and got stuck? [Browse the
documentation](https://docs.ropensci.org/githist/) to see if you can find a
Using `repometrics` and got stuck? [Browse the
documentation](https://docs.ropensci.org/repometrics/) to see if you can find a
solution. Still stuck? Post your question as an [issue on
GitHub](https://github.com/ropensci-review-tools/githist/issues). While we
GitHub](https://github.com/ropensci-review-tools/repometrics/issues). While we
cannot offer user support, we'll try to do our best to address it, as questions
often lead to better documentation or the discovery of bugs.

Expand All @@ -49,11 +49,11 @@ Want to ask a question in private? Contact the package maintainer by

### Propose an idea 💡

Have an idea for a new `githist` feature? Take a look at [the
documentation](https://docs.ropensci.org/githist/) and [issues
list](https://github.com/ropensci-review-tools/githist/issues) to see if it
Have an idea for a new `repometrics` feature? Take a look at [the
documentation](https://docs.ropensci.org/repometrics/) and [issues
list](https://github.com/ropensci-review-tools/repometrics/issues) to see if it
isn't included or suggested yet. If not, suggest your idea as an [issue on
GitHub](https://github.com/ropensci-review-tools/githist/issues/new).
GitHub](https://github.com/ropensci-review-tools/repometrics/issues/new).
While we can't promise to implement your idea, it helps to:

* Explain in detail how it would work.
Expand All @@ -63,17 +63,17 @@ See below if you want to contribute code for your idea as well.

### Report a bug 🐛

Using `githist` and discovered a bug? That's annoying! Don't let others have
Using `repometrics` and discovered a bug? That's annoying! Don't let others have
the same experience and report it as an [issue on
GitHub](https://github.com/ropensci-review-tools/githist/issues/new) so we can
GitHub](https://github.com/ropensci-review-tools/repometrics/issues/new) so we can
fix it. A good bug report makes it easier for us to do so, so please:

- Use [the `reprex` package](https://reprex.tidyverse.org) to create a
reproducible example.
- Include the version of `githist` with the following line in your `reprex`
- Include the version of `repometrics` with the following line in your `reprex`
code:
```
packageVersion("githist")
packageVersion("repometrics")
```

### Improve the documentation 📖
Expand All @@ -84,15 +84,15 @@ welcome!

#### The website

[This website](https://docs.ropensci.org/githist/) is generated with
[This website](https://docs.ropensci.org/repometrics/) is generated with
[`pkgdown`](http://pkgdown.r-lib.org/). That means we don't have to write any
html: content is pulled together from documentation in the code, vignettes,
[Markdown](https://guides.github.com/features/mastering-markdown/) files, the
package `DESCRIPTION` and `_pkgdown.yml` settings. If you know your way around
`pkgdown`, you can [propose a file
change](https://help.github.com/articles/editing-files-in-another-user-s-repository/)
to improve documentation. If not, [report an
issue](https://github.com/ropensci-review-tools/githist/issues/new) and we can
issue](https://github.com/ropensci-review-tools/repometrics/issues/new) and we can
point you in the right direction.

#### Function documentation
Expand All @@ -102,7 +102,7 @@ documentation using [`roxygen2`](https://klutometis.github.io/roxygen/). If you
want to improve a function description:

1. Go to `R/` directory in the [code
repository](https://github.com/ropensci-review-tools/githist/tree/main/R).
repository](https://github.com/ropensci-review-tools/repometrics/tree/main/R).
2. Look for the file with the name of the function.
3. [Propose a file
change](https://help.github.com/articles/editing-files-in-another-user-s-repository/)
Expand All @@ -111,9 +111,9 @@ want to improve a function description:

### Contribute code 📝

Care to fix bugs or implement new functionality for `githist`? Awesome! 👏
Care to fix bugs or implement new functionality for `repometrics`? Awesome! 👏
Have a look at the [issue
list](https://github.com/ropensci-review-tools/githist/issues) and leave a
list](https://github.com/ropensci-review-tools/repometrics/issues) and leave a
comment on the things you want to work on. See also the development guidelines
below.

Expand All @@ -122,7 +122,7 @@ below.
We try to follow the [GitHub
flow](https://guides.github.com/introduction/flow/) for development.

1. Fork [this repo](https://github.com/ropensci-review-tools/githist/) and
1. Fork [this repo](https://github.com/ropensci-review-tools/repometrics/) and
clone it to your computer. To learn more about this process, see [this
guide](https://guides.github.com/activities/forking/).
2. If you have forked and cloned the project before and it has been a while
Expand All @@ -141,11 +141,11 @@ flow](https://guides.github.com/introduction/flow/) for development.

## Code style

The `githist` coding style diverges somewhat from [the commonly used tidyverse
The `repometrics` coding style diverges somewhat from [the commonly used tidyverse
style guide](https://style.tidyverse.org/syntax.html#spacing), primarily
through judicious use of
whitespace, which aims to improve code readability. Code references in
`githist` are separated by whitespace, just like words of text. Just like it
`repometrics` are separated by whitespace, just like words of text. Just like it
is easier to understand "these three words" than "thesethreewords", code is
formatted like this:

Expand All @@ -165,7 +165,7 @@ The position of brackets is then arbitrary, and we could also write
these <- three( words (x))
```

`githist` code opts for the former style, with the natural result that one
`repometrics` code opts for the former style, with the natural result that one
ends up writing

```r
Expand Down
15 changes: 8 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Package: githist
Title: Code analyses traced along the 'git' history of a package
Version: 0.1.0.049
Package: repometrics
Title: Metrics for Your Code Repository
Version: 0.1.1.005
Authors@R:
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-2172-5265"))
Description: Code analyses traced along the 'git' history of a package.
Description: Metrics for your code repository. Call one function to generate an
interactive dashboard displaying the state of your code.
License: GPL-3
URL: https://docs.ropensci.org/githist/,
https://github.com/ropensci-review-tools/githist
BugReports: https://github.com/ropensci-review-tools/githist/issues
URL: https://docs.ropensci.org/repometrics/,
https://github.com/ropensci-review-tools/repometrics
BugReports: https://github.com/ropensci-review-tools/repometrics/issues
Imports:
checkmate,
cli,
Expand Down
4 changes: 2 additions & 2 deletions R/chaoss-metrics-external.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' Extract total CRAN downloads for nominated package over period defined by
#' `options("githist_period")`.
#' `options("repometrics_period")`.
#'
#' @param pkg_name Name of package. For packages not on CRAN, the 'cranlogs'
#' API returns download counts of 0.
Expand All @@ -10,7 +10,7 @@ cran_downloads <- function (pkg_name, end_date = Sys.Date ()) {

checkmate::assert_character (pkg_name, len = 1L)
checkmate::assert_date (end_date)
period <- get_githist_period ()
period <- get_repometrics_period ()
start_date <- as.Date (end_date - period)
interval <- paste (start_date, sep = ":", end_date)

Expand Down
4 changes: 2 additions & 2 deletions R/chaoss-metrics-internal.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
chaoss_internal_num_commits <- function (path, end_date = Sys.Date ()) {

log <- git_log_in_period (path, end_date, get_githist_period ())
log <- git_log_in_period (path, end_date, get_repometrics_period ())

return (nrow (log))
}

chaoss_internal_num_contributors <- function (path, end_date = Sys.Date ()) {

log <- git_log_in_period (path, end_date, get_githist_period ())
log <- git_log_in_period (path, end_date, get_repometrics_period ())

auths_un <- unique (log$author)

Expand Down
5 changes: 3 additions & 2 deletions R/quarto-dashboard.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ ghist_dashboard <- function (results, action = "preview") {
results <- daily_average (results, "desc_data")
results <- daily_average (results, "loc")

path_src <- system.file ("extdata", "quarto", package = "githist")
dir <- fs::dir_copy (path_src, fs::path_temp ())
path_src <- system.file ("extdata", "quarto", package = "repometrics")
path_dest <- fs::path (fs::path_temp (), "quarto")
dir <- fs::dir_copy (path_src, path_dest, overwrite = TRUE)
saveRDS (results, fs::path (dir, "results.Rds"))

pkg_name <- results$desc_data$package [1]
Expand Down
2 changes: 1 addition & 1 deletion R/githist-package.R → R/repometrics-package.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @keywords internal
#' @importFrom memoise memoise
#' @aliases githist-package
#' @aliases repometrics-package
"_PACKAGE"

# The following block is used by usethis to automatically manage
Expand Down
12 changes: 6 additions & 6 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@

op <- options ()

op.githist <- list (
githist_period = 90
op.repometrics <- list (
repometrics_period = 90
)

toset <- !(names (op.githist) %in% names (op))
toset <- !(names (op.repometrics) %in% names (op))
if (any (toset)) {
options (op.githist [toset])
options (op.repometrics [toset])
}
invisible ()
}
# nocov end

get_githist_period <- function () {
period <- getOption ("githist_period")
get_repometrics_period <- function () {
period <- getOption ("repometrics_period")
checkmate::assert_int (period, lower = 1L)
return (period)
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!-- badges: start -->

[![R build
status](https://github.com/ropensci-review-tools/githist/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci-review-tools/githist/actions?query=workflow%3AR-CMD-check)
[![codecov](https://codecov.io/gh/ropensci-review-tools/githist/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci-review-tools/githist)
status](https://github.com/ropensci-review-tools/repometrics/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci-review-tools/repometrics/actions?query=workflow%3AR-CMD-check)
[![codecov](https://codecov.io/gh/ropensci-review-tools/repometrics/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ropensci-review-tools/repometrics)
[![Project Status:
Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
<!-- badges: end -->

# githist
# repometrics

Code analyses run over the git history of a package.
Metrics for your code repository.

## Code of Conduct

Expand Down
22 changes: 11 additions & 11 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "githist",
"description": "Code analyses traced along the 'git' history of a package.",
"name": "githist: Code analyses traced along the 'git' history of a package",
"relatedLink": "https://docs.ropensci.org/githist/",
"codeRepository": "https://github.com/ropensci-review-tools/githist",
"issueTracker": "https://github.com/ropensci-review-tools/githist/issues",
"identifier": "repometrics",
"description": "Metrics for your code repository. Call one function to generate an interactive dashboard displaying the state of your code.",
"name": "repometrics: Metrics for Your Code Repository",
"relatedLink": "https://docs.ropensci.org/repometrics/",
"codeRepository": "https://github.com/ropensci-review-tools/repometrics",
"issueTracker": "https://github.com/ropensci-review-tools/repometrics/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.0.049",
"version": "0.1.1.005",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -225,11 +225,11 @@
},
"SystemRequirements": {}
},
"fileSize": "90.739KB",
"readme": "https://github.com/ropensci-review-tools/githist/blob/main/README.md",
"fileSize": "125.292KB",
"readme": "https://github.com/ropensci-review-tools/repometrics/blob/main/README.md",
"contIntegration": [
"https://github.com/ropensci-review-tools/githist/actions?query=workflow%3AR-CMD-check",
"https://app.codecov.io/gh/ropensci-review-tools/githist"
"https://github.com/ropensci-review-tools/repometrics/actions?query=workflow%3AR-CMD-check",
"https://app.codecov.io/gh/ropensci-review-tools/repometrics"
],
"developmentStatus": "https://www.repostatus.org/#active"
}
4 changes: 2 additions & 2 deletions inst/extdata/quarto/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ website:
- icon: "github"
menu:
- text: Source Code
url: https://github.com/ropensci-review-tools/githist
url: https://github.com/ropensci-review-tools/repometrics
- text: Request a Feature
url: https://github.com/ropensci-review-tools/githist/issues/new
url: https://github.com/ropensci-review-tools/repometrics/issues/new

format:
html:
Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/quarto/fn-stats.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ format:
---

```{r load-pkg, echo = FALSE, message = FALSE}
library (githist)
library (repometrics)
library (lubridate)
```
This page includes several graphs providing insight into the historical
Expand Down
2 changes: 1 addition & 1 deletion inst/httptest2/redact.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function (resp) {
fixed = TRUE
)

test_repo <- "ropensci-review-tools/githist"
test_repo <- "ropensci-review-tools/repometrics"
resp <- httptest2::gsub_response (
resp,
paste0 (test_repo, "/actions"),
Expand Down
23 changes: 0 additions & 23 deletions man/githist-package.Rd

This file was deleted.

Loading