Skip to content

Commit

Permalink
docs: updated pkgdown configuraion && made a version bump action
Browse files Browse the repository at this point in the history
  • Loading branch information
kpagacz committed Nov 10, 2024
1 parent 2c7020b commit f820e77
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 12 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/version-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
on:
push:
branches: [main]
paths:
- "antidotum/**"

name: Version bump

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/create-github-app-token@v1
id: minion-token
with:
app-id: ${{ vars.MINION_APPID }}
private-key: ${{ secrets.MINION_PKEY }}

- uses: actions/checkout@v4
with:
token: ${{ steps.minion-token.outputs.token }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: local::.
working-directory: "./antidotum/tergo"

- name: Bump version
working-directory: ./antidotum/tergo
run: |
Rscript -e "desc::desc_version_bump('dev')"
git config --global user.email "[email protected]"
git config --global user.name "Github Minion"
version=$(Rscript -e 'desc::desc_get_version()' | cut -d' ' -f2)
git add --all && git commit -m "Version bumped to $version [skip ci]"
git push origin main
4 changes: 2 additions & 2 deletions antidotum/tergo/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Suggests:
rextendr (== 0.3.1),
roxygen2,
devtools,
pkgdown
pkgdown,
desc
URL: https://r.tergo.pagacz.io,
https://github.com/kpagacz/tergo
BugReports: https://github.com/kpagacz/tergo/issues

1 change: 1 addition & 0 deletions antidotum/tergo/NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(get_default_config)
export(style)
export(style_file)
export(style_pkg)
Expand Down
5 changes: 4 additions & 1 deletion antidotum/tergo/R/extendr-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ get_config <- function(path) .Call(wrap__get_config, path)

#' Get the default configuration
#'
#' This configuration is used by the styling functions
#' if no value is provided for the configuration keys.
#'
#' @return `list` with the default configuration
#' @keywords internal
#' @export
get_default_config <- function() .Call(wrap__get_default_config)


Expand Down
4 changes: 1 addition & 3 deletions antidotum/tergo/R/styling.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
#' @param config_file (`character`) the path to the configuration file
#' @param configuration (`list`) the path to the configuration for formatting
#'
#' @export
#' @examples
#' style()
#' style(config_file = "tergo.toml", configuration = list())
#'
#' @export
style <- function(config_file = "tergo.toml", configuration = list()) {
style_pkg(path = getwd(), config_file = config_file, configuration = configuration)
}
Expand Down Expand Up @@ -108,4 +107,3 @@ style_file <- function(file, configuration = list()) {
style_text <- function(text, configuration = list()) {
vapply(X = text, FUN = function(code) format_code(code, configuration), FUN.VALUE = character(1), USE.NAMES = FALSE)
}

6 changes: 3 additions & 3 deletions antidotum/tergo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Requires [Rust tooling](https://www.rust-lang.org/tools/install):
if (!require(remotes)) {
install.packages("remotes")
}
remotes::install_github("kpagacz/tergo@v0.1.3", subdir = "antidotum/tergo")
remotes::install_github("kpagacz/tergo@latest", subdir = "antidotum/tergo")
```

### From R-Universe
Expand All @@ -60,7 +60,7 @@ tergo::style()

`tergo` reads the configuration from a TOML file (`tergo.toml`) in your package root.
See [the library documentation for possible values and their
explanation](/balnea/README.md).
explanation](https://github.com/kpagacz/tergo/blob/cf-pages/balnea/README.md).

### As an argument to styling functions

Expand All @@ -69,4 +69,4 @@ you modify the styling behaviour without a configuration file.

The keys and the possible values are the same as in the TOML file.
See [the library documentation for possible values and their
explanation](/balnea/README.md).
explanation](https://github.com/kpagacz/tergo/blob/cf-pages/balnea/README.md).
10 changes: 10 additions & 0 deletions antidotum/tergo/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
reference:
- title: Styling
desc: Functions to style R code
contents:
- starts_with("style")
- title: Configuration
desc: Configuration functions
contents:
- get_default_config
4 changes: 2 additions & 2 deletions antidotum/tergo/man/get_default_config.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion antidotum/tergo/src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,13 @@ fn get_config(path: &str) -> extendr_api::List {

/// Get the default configuration
///
/// This configuration is used by the styling functions
/// if no value is provided for the configuration keys.
///
/// @return `list` with the default configuration
/// @keywords internal
/// @export
/// @examples
/// get_default_config()
#[extendr]
fn get_default_config() -> extendr_api::List {
let config = Config::default();
Expand Down
Binary file modified antidotum/tergo/src/rust/vendor.tar.xz
Binary file not shown.

0 comments on commit f820e77

Please sign in to comment.