Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Jun 3, 2024
0 parents commit cbdc40c
Show file tree
Hide file tree
Showing 13 changed files with 330 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.hooks/
WORDLIST$
^.*.zip$
^.*\.Rproj$
^CONDUCT\.md$
^CONTRIBUTING\.md$
^README-.*\.png$
^README\.Rmd$
^README\.html$
^\.Rproj\.user$
^\.github$
^\.pre-commit-config\.yaml$
^_pkgdown\.yml$
^aaa*
^codemeta\.json$
^cran-comments.md$
^inst/WORDLIST$
^makefile$
^temp*
^vignettes/makefile$
data-raw/
docs/
scripts/
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
# - {os: macos-latest, r: 'release'}
# - {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
# - {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
16 changes: 16 additions & 0 deletions .hooks/description
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env Rscript

# only stop on main branch
on_main <- identical (gert::git_branch (), "main")

s <- gert::git_status()
chk <- ("DESCRIPTION" %in% s$file &&
(s$status [s$file == "DESCRIPTION"] == "modified" |
s$status [s$file == "DESCRIPTION"] == "new"))
if (!chk & on_main)
stop ("DESCRIPTION has not been updated")

f <- file.path (here::here(), "DESCRIPTION")
x <- system2 ("git", args = c ("diff", "--cached", "-U0", f), stdout = TRUE)
if (!any (grepl ("^\\+Version", x)) & on_main)
stop ("Version number in DESCRIPTION has not been incremented")
82 changes: 82 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# All available hooks: https://pre-commit.com/hooks.html
# R specific hooks: https://github.com/lorenzwalthert/precommit
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.2
hooks:
- id: style-files
args: [--style_pkg=spaceout, --style_fun=spaceout_style]
additional_dependencies:
- ropensci-review-tools/spaceout
# - id: roxygenize
# codemeta must be above use-tidy-description when both are used
# - id: codemeta-description-updated
- id: use-tidy-description
- id: spell-check
exclude: >
(?x)^(
.*\.[rR]|
.*\.feather|
.*\.jpeg|
.*\.pdf|
.*\.png|
.*\.py|
.*\.RData|
.*\.rds|
.*\.Rds|
.*\.Rproj|
.*\.sh|
(.*/|)\.gitignore|
(.*/|)\.gitlab-ci\.yml|
(.*/|)\.lintr|
(.*/|)\.pre-commit-.*|
(.*/|)\.Rbuildignore|
(.*/|)\.Renviron|
(.*/|)\.Rprofile|
(.*/|)\.travis\.yml|
(.*/|)appveyor\.yml|
(.*/|)NAMESPACE|
(.*/|)renv/settings\.dcf|
(.*/|)renv\.lock|
(.*/|)WORDLIST|
\.github/workflows/.*|
data/.*|
)$
# - id: lintr
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-print-statement
- id: no-debug-statement
- id: deps-in-desc
# - id: pkgdown
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ['--maxkb=200']
- id: file-contents-sorter
files: '^\.Rbuildignore$'
- id: end-of-file-fixer
exclude: '\.Rd'
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
# Only required when https://pre-commit.ci is used for config validation
- id: check-pre-commit-ci-config
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit common R artifacts
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
language: fail
files: '\.(Rhistory|RData|Rds|rds)$'
# `exclude: <regex>` to allow committing specific files
- id: description version
name: Version has been incremeneted in DESCRIPTION
entry: .hooks/description
language: script

ci:
autoupdate_schedule: monthly
# skip: [pkgdown]
16 changes: 16 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Package: naturoute
Title: Routing through natural spaces
Version: 0.0.0
Authors@R:
person(given = "Mark",
family = "Padgham",
role = c("aut", "cre"),
email = "[email protected]")
Description: Routing through natural spaces.
License: GPL-3
URL: https://github.com/UrbanAnalyst/naturoute
BugReports: https://github.com/UrbanAnalyst/naturoute/issues
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Generated by roxygen2: do not edit by hand
9 changes: 9 additions & 0 deletions R/naturoute-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#' @keywords internal
#' @aliases naturoute-package
"_PACKAGE"

# The following block is used by usethis to automatically manage
# roxygen namespace tags. Modify with care!
## usethis namespace: start
## usethis namespace: end
NULL
32 changes: 32 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: "naturoute"
output:
md_document:
variant: markdown_github

rmarkdown::html_vignette:
self_contained: no
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r opts, echo = FALSE}
knitr::opts_chunk$set (
collapse = TRUE,
warning = TRUE,
message = TRUE,
width = 120,
comment = "#>",
fig.retina = 2,
fig.path = "README-"
)
```

[![R build
status](https://github.com/UrbanAnalyst/naturoute/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/naturoute/actions?query=workflow%3AR-CMD-check)
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)


# naturoute

Routing through natural spaces.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- README.md is generated from README.Rmd. Please edit that file -->

[![R build
status](https://github.com/UrbanAnalyst/naturoute/workflows/R-CMD-check/badge.svg)](https://github.com/UrbanAnalyst/naturoute/actions?query=workflow%3AR-CMD-check)
[![Project Status:
Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)

# naturoute

Routing through natural spaces.
39 changes: 39 additions & 0 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "naturoute",
"description": "Routing through natural spaces.",
"name": "naturoute: Routing through natural spaces",
"codeRepository": "https://github.com/UrbanAnalyst/naturoute",
"issueTracker": "https://github.com/UrbanAnalyst/naturoute/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.0.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.0 (2024-04-24)",
"author": [
{
"@type": "Person",
"givenName": "Mark",
"familyName": "Padgham",
"email": "[email protected]"
}
],
"maintainer": [
{
"@type": "Person",
"givenName": "Mark",
"familyName": "Padgham",
"email": "[email protected]"
}
],
"softwareRequirements": {
"SystemRequirements": null
},
"fileSize": "1.711KB",
"contIntegration": "https://github.com/UrbanAnalyst/naturoute/actions?query=workflow%3AR-CMD-check",
"developmentStatus": "https://www.repostatus.org/#active"
}
29 changes: 29 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
RFILE = README
VIGNETTE = parallel

all: init vignette

init:
echo "pkgdown::init_site()" | R --no-save -q

site:
echo "pkgdown::build_site()" | R --no-save q

vignette:
echo "pkgdown::build_article('$(VIGNETTE)',quiet=FALSE)" | R --no-save -q

knith: $(RFILE).Rmd
echo "rmarkdown::render('$(RFILE).Rmd',output_file='$(RFILE).html')" | R --no-save -q

doc: clean
Rscript -e 'devtools::document()'
Rscript -e 'rmarkdown::render("$(RFILE).Rmd",rmarkdown::md_document(variant="gfm"))'

open:
xdg-open docs/articles/$(VIGNETTE).html &

check:
Rscript -e 'library(pkgcheck); checks <- pkgcheck(); print(checks); summary (checks)'

clean:
rm -rf *.html *.png README_cache docs/
23 changes: 23 additions & 0 deletions man/naturoute-package.Rd

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

0 comments on commit cbdc40c

Please sign in to comment.