Skip to content

Commit efbb7ad

Browse files
committed
init: initialize R package
1 parent f4ff02b commit efbb7ad

35 files changed

+575
-34
lines changed

.Rbuildignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
^noclocksai\.Rproj$
22
^\.Rproj\.user$
33
^dev$
4+
^codecov\.yml$
5+
^\.github$
6+
^\.covrignore$
7+
~\$.*
8+
^\.lintr$
9+
^\.gitattributes$
10+
^\.editorconfig$
11+
^codemeta\.json$
12+
^config\.yml$
13+
^\.dockerignore$
14+
^Dockerfile$
15+
^data-raw$
16+
^CHANGELOG\.md$

.covrignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dev/
2+
inst/
3+
data-raw

.editorconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[*]
2+
indent_style = space
3+
indent_size = 2
4+
end_of_line = lf
5+
charset = utf-8
6+
trim_trailing_whitespace = true
7+
insert_final_newline = true
8+
9+
[*.R]
10+
indent_size = 2
11+
max_line_length = 120
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[*.json]
17+
insert_final_newline = ignore
18+
19+
[Makefile]
20+
indent_style = tab
21+
22+
[*.bat]
23+
indent_style = tab

.gitattributes

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Global
2+
# -------------
3+
* text=auto
4+
tests/fixtures/**/* -diff
5+
6+
# R Files
7+
# -------------
8+
*.{R,Rmd,Rd,Rproj,[Rr]environ,[Rr]profile,[Rr]history} text
9+
10+
# Binary Files
11+
# -------------
12+
*.{R[Dd]ata,R[Dd][Ss],rda,rdb,rds,Rdx} binary
13+
*.zip binary
14+
*.{pdf,png,jpg,jpeg,gif} binary
15+
16+
# Linguist
17+
# -------------
18+
.[Rr]md linguist-detectable
19+
*.{md,markdown,txt} linguist-documentation
20+
docs/** linguist-documentation
21+
vignettes/** linguist-documentation
22+
*.{js,css,scss,less} linguist-vendored
23+
*.{min.js,min.css} linguist-generated
24+

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
assignees:
8+
- "jimbrig"

.github/workflows/changelog.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Automate Changelog
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
jobs:
9+
changelog:
10+
name: Generate Changelog
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
- name: Run Git Cliff
19+
uses: tj-actions/[email protected]
20+
id: git-cliff
21+
with:
22+
args: "--verbose"
23+
output: "CHANGELOG.md"
24+
template-config: https://raw.githubusercontent.com/noclocks/.github/main/workflow-templates/cliff.template.toml
25+
- name: Print Changelog
26+
id: print-changelog
27+
run: |
28+
cat "CHANGELOG.md"
29+
# Commit and push the updated changelog, IF not a pull request
30+
- name: Commit and Push Changelog
31+
if: github.event_name != 'pull_request'
32+
run: |
33+
git config user.name 'github-actions[bot]'
34+
git config user.email 'github-actions[bot]@users.noreply.github.com'
35+
set +e
36+
git add CHANGELOG.md
37+
git commit -m "[chore]: update changelog"
38+
git push https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git "main"

.github/workflows/test-coverage.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test Coverage
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
workflow_dispatch:
9+
10+
permissions: read-all
11+
12+
jobs:
13+
coverage:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
CODCOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
use-public-rspm: true
25+
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr, any::xml2
29+
needs: coverage
30+
31+
- name: Test coverage
32+
run: |
33+
cov <- covr::package_coverage(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
38+
print(cov)
39+
covr::to_cobertura(cov)
40+
shell: Rscript {0}
41+
42+
- uses: codecov/codecov-action@v4
43+
with:
44+
# Fail if error if not on PR, or if on PR and token is given
45+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
46+
file: ./cobertura.xml
47+
plugin: noop
48+
disable_search: true
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
51+
- name: Show testthat output
52+
if: always()
53+
run: |
54+
## --------------------------------------------------------------------
55+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
56+
shell: bash
57+
58+
- name: Upload test results
59+
if: failure()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: coverage-test-failures
63+
path: ${{ runner.temp }}/package

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
.httr-oauth
55
.DS_Store
66
.quarto
7+
inst/doc

.lintr

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
linters: linters_with_defaults(
2+
line_length_linter(120),
3+
commented_code_linter = NULL,
4+
trailing_blank_lines_linter = NULL
5+
)
6+
exclusions: list()
7+
encoding: "UTF-8"
8+

CHANGELOG.md

Whitespace-only changes.

DESCRIPTION

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,27 @@ Authors@R: c(
1010
Description: The `noclocksai` package provides a set of tools for working
1111
with AI at No Clocks, LLC.
1212
License: file LICENSE
13+
URL: https://github.com/noclocks/noclocksai
14+
BugReports: https://github.com/noclocks/noclocksai/issues
15+
Imports:
16+
cli,
17+
ellmer,
18+
pkgload,
19+
purrr,
20+
rlang,
21+
stringr,
22+
utils,
23+
whisker,
24+
yaml
25+
Suggests:
26+
knitr,
27+
rmarkdown,
28+
spelling,
29+
testthat (>= 3.0.0)
30+
VignetteBuilder:
31+
knitr
32+
Config/testthat/edition: 3
1333
Encoding: UTF-8
1434
Language: en-US
1535
Roxygen: list(markdown = TRUE)
1636
RoxygenNote: 7.3.2
17-
Suggests:
18-
knitr,
19-
rmarkdown
20-
VignetteBuilder: knitr
21-
URL: https://github.com/noclocks/noclocksai
22-
BugReports: https://github.com/noclocks/noclocksai/issues

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright 2025 No Clocks, LLC. All rights reserved.

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(pkg_sys)
4+
importFrom(rlang,"%||%")
5+
importFrom(rlang,.data)
6+
importFrom(rlang,.env)

R/noclocksai-package.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#' @keywords internal
2+
"_PACKAGE"
3+
4+
## usethis namespace: start
5+
#' @importFrom rlang %||%
6+
#' @importFrom rlang .data
7+
#' @importFrom rlang .env
8+
## usethis namespace: end
9+
NULL

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# noclocksai <img src="man/figures/logo.png" align="right" height="120" alt="" />
3+
4+
5+
<!-- badges: start -->
6+
[![Codecov test coverage](https://codecov.io/gh/noclocks/noclocksai/graph/badge.svg)](https://app.codecov.io/gh/noclocks/noclocksai)
7+
<!-- badges: end -->
8+
9+
The goal of noclocksai is to ...
10+
11+
## Installation
12+
13+
You can install the development version of noclocksai like so:
14+
15+
``` r
16+
# FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE?
17+
```
18+
19+
## Example
20+
21+
This is a basic example which shows you how to solve a common problem:
22+
23+
``` r
24+
library(noclocksai)
25+
## basic example code
26+
```
27+

codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
comment: false
2+
3+
coverage:
4+
status:
5+
project:
6+
default:
7+
target: auto
8+
threshold: 1%
9+
informational: true
10+
patch:
11+
default:
12+
target: auto
13+
threshold: 1%
14+
informational: true

0 commit comments

Comments
 (0)