autonewsmd

Auto-Generate Changelog using Conventional Commits

https://github.com/kapsner/autonewsmd

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

automation changelog-generator conventional-commits cran r r-package
Last synced: 10 months ago · JSON representation

Repository

Auto-Generate Changelog using Conventional Commits

Basic Info
Statistics
  • Stars: 14
  • Watchers: 1
  • Forks: 1
  • Open Issues: 1
  • Releases: 5
Topics
automation changelog-generator conventional-commits cran r r-package
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

autonewsmd

CRAN
checks Dependencies R build
status R build
status R build
status

The purpose of the autonewsmd R package is to bring the power of conventional commit messages to the R community. There is no need anymore to tediously maintain a changelog file manually. If you are using conventional commit messages, autonewsmd will do that for you and automatically generate a human readable changelog file directly from the repository’s git history.

Conventional commit messages (https://www.conventionalcommits.org/en/v1.0.0/) come with some easy rules to create human readable commit messages for a git history. One advantage is that following these conventions, these messages are also machine readable and automated tools can run on top of them in order to, e.g., generate beautiful changelogs out of them. Similar tools written in other programming languages are, for example, auto-changelog for JavaScript and auto-changelog for Python.

Installation

You can install autonewsmd with:

r install.packages("autonewsmd")

You can install the development version of autonewsmd with:

r install.packages("remotes") remotes::install_github("kapsner/autonewsmd")

Supported Commit Types

The default changelog template organizes commits according to their association with specific tags. The tags form the headings of the changelog file and are sorted in decreasing order according to their release dates. The following table lists the commit types that are currently supported by autonewsmd. To be correctly recognized by autonewsmd, it is important that the formatting of the commit messages follow the conventions described here.

| Type | Changelog Subheading | |-----------|----------------------| | feat: | New features | | fix: | Bug fixes | | refactor: | Refactorings | | perf: | Performance | | build: | Build | | test: | Tests | | ci: | CI | | docs: | Docs | | style: | Style | | chore: | Other changes |

If any commit type includes BREAKING CHANGE in its commit message’s body or footer, the subheading Breaking changes is included as first subheading within the respective sections. Furthermore, the detection of breaking changes using the exclamation mark (!) between the type description and the colon (as described here) is supported as well.

Example

First of all, create a small repository with some commit messages.

``` r library(autonewsmd)

(Example is based on the public examples from the git2r R package)

Initialize a repository

path <- file.path(tempdir(), "autonewsmd") dir.create(path) repo <- git2r::init(path)

Config user

git2r::config(repo, user.name = "Alice", user.email = "alice@example.org") git2r::remoteseturl(repo, "foobar", "https://example.org/git2r/foobar")

Write to a file and commit

lines <- "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do" writeLines(lines, file.path(path, "example.txt"))

git2r::add(repo, "example.txt") git2r::commit(repo, "feat: new file example.txt")

Write again to a file and commit

Sys.sleep(2) # wait two seconds, otherwise, commit messages have same time stamp lines2 <- paste0( "eiusmod tempor incididunt ut labore et dolore magna aliqua. ", "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris ", "nisi ut aliquip ex ea commodo consequat." ) write(lines2, file.path(path, "example.txt"), append = TRUE)

git2r::add(repo, "example.txt") git2r::commit(repo, "refactor: added second phrase")

Also add a tag here

git2r::tag(repo, "v0.0.1") ```

Then, instantiate an autonewsmd object. Here, you must provide the repo_name (this argument is used to compose the title of the changelog file). The repo_path-argument can be provided optionally and defaults to the current working directory ("."). The repo_path should be the root of a git repository. The $generate()-method creates a list with all commit messages that is used for rendering the changelog file.

r an <- autonewsmd$new(repo_name = "TestRepo", repo_path = path) an$generate()

Executing the $write()-method, the changelog is written to the path specified with the repo_path-argument. If force = FALSE (the default), a dialog is prompted to ask the user if the file should be (over-) written.

r an$write(force = TRUE)

Now, we can verify that the file NEWS.md also appears in the git folder and check its content.

``` r list.files(path)

> [1] "example.txt" "NEWS.md"

```

``` r newsmd <- readLines(file.path(path, "NEWS.md")) newsmd

> [1] "# TestRepo NEWS"

> [2] ""

> [3] "## v0.0.1 (2022-08-27)"

> [4] ""

> [5] "#### New features"

> [6] ""

> [7] "- new file"

> [8] " (22b8453)"

> [9] ""

> [10] "#### Refactorings"

> [11] ""

> [12] "- added second phrase"

> [13] " (ec510eb)"

> [14] ""

> [15] "Full set of changes:"

> [16] "22b8453...v0.0.1"

```

Used By

autonewsmd, sjtable2df, rBiasCorrection, BiasCorrector, DIZtools, DIZutils, DQAstats, DQAgui, miRacumDQA, kdry, mlexperiments, mllrnrs, mlsurvlrnrs authors-block

(If you are using autonewsmd and you like to have your repository listed here, please add the link pointing to the changelog file to this README.md and create a pull request.)

Related R Packages

  • newsmd: manually add updates (version or bullet points) to the NEWS.md file
  • fledge: to streamline the process of updating changelogs (NEWS.md) and versioning R packages developed in git repositories (also supporting conventional commits)

TODOs:

Owner

  • Login: kapsner
  • Kind: user
  • Location: Erlangen, Germany

Medical Data Scientist.

GitHub Events

Total
  • Issues event: 2
  • Watch event: 1
Last Year
  • Issues event: 2
  • Watch event: 1

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 5
  • Total pull requests: 3
  • Average time to close issues: 23 days
  • Average time to close pull requests: about 16 hours
  • Total issue authors: 3
  • Total pull request authors: 3
  • Average comments per issue: 1.4
  • Average comments per pull request: 2.33
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • kapsner (3)
  • pat-s (1)
  • maelle (1)
  • seanthimons (1)
Pull Request Authors
  • kapsner (1)
  • yihui (1)
  • joundso (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 412 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 1
cran.r-project.org: autonewsmd

Auto-Generate Changelog using Conventional Commits

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 412 Last month
Rankings
Stargazers count: 17.0%
Forks count: 28.8%
Average: 29.5%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 36.4%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4 depends
  • R6 * imports
  • data.table * imports
  • git2r * imports
  • magrittr * imports
  • rmarkdown * imports
  • utils * imports
  • knitr * suggests
  • lintr * suggests
  • testthat >= 3.0.1 suggests
.github/workflows/coverage.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • pat-s/always-upload-cache main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/lint.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • pat-s/always-upload-cache main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/tic.yml actions
  • actions/checkout v3 composite
  • actions/setup-java v1 composite
  • actions/upload-artifact v2 composite
  • pat-s/always-upload-cache v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite