Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
# Fail if error if not on PR, or if on PR and token is given
# fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: RcppTskit/cobertura.xml
files: RcppTskit/cobertura.xml # generated during the process
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
113 changes: 1 addition & 112 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,115 +128,4 @@ vignette("RcppTskit_intro")

## Development

### Code of Conduct

Please note that the `RcppTskit` project is released with a
[Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

### Clone

First clone the repository and step into the directory:

```
git clone https://github.com/HighlanderLab/RcppTskit.git
cd RcppTskit
```

### Pre-commit install

We use [pre-commit](https://pre-commit.com) hooks to ensure code quality.
Specifically, we use:
* [air](https://github.com/posit-dev/air) to format `R` code,
* [jarl](https://github.com/etiennebacher/jarl) to lint `R` code,
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format `C/C++` code, and
* [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) to lint `C/C++` code.

To install the hooks, run:

```
pre-commit install --install-hooks
pre-commit install --hook-type pre-push
```

Run these once per clone.
This enables automatic checks on `commit` and `push`.

### tskit

If you plan to update `tskit`, follow instructions in `extern/README.md`.

### RcppTskit

Then open `RcppTskit` package directory in your favourite `R` editor
(Positron, RStudio, text-editor-of-your-choice, etc.) and implement your changes.

You should routinely `R CMD check` your changes (in `R`):

```
# Note that the RcppTskit R package is in the RcppTskit sub-directory
setwd("path/to/RcppTskit/RcppTskit")

# Check
devtools::check()

# Install
devtools::install()

# Test
devtools::test()

# Test coverage
cov <- covr::package_coverage(clean = TRUE)
covr::report(cov)
```

Alternatively check your changes from the command line:

```
# Note that the RcppTskit package is in the RcppTskit sub-directory
cd path/to/RcppTskit/RcppTskit

# Check
R CMD build RcppTskit
R CMD check RcppTskit_*.tar.gz

# Install
R CMD INSTALL RcppTskit_*.tar.gz
```

On Windows, replace `tar.gz` with `zip`.

### Pre-commit run

When committing your changes,
`pre-commit` hooks should kick-in automatically
to ensure code quality.
Manually, you can run them using:

```
pre-commit autoupdate # to update the hooks
pre-commit run # on changed files
pre-commit run --all-files # on all files
pre-commit run <hook_id> # just a specific hook
pre-commit run <hook_id> --all-files # ... on all files
# see also --hook-stage option
```

### Continuous integration

We use Github Actions to run continuous integration (CI) checks
on each push and pull request.
Specifically, we run:
* [R CMD check](.github/workflows/R-CMD-check.yaml) on multiple platforms
(see curent status [here](https://github.com/HighlanderLab/RcppTskit/actions/workflows/R-CMD-check.yaml)),
* [documentation generation](.github/workflows/document.yaml)
(see current status [here](https://github.com/HighlanderLab/RcppTskit/actions/workflows/document.yaml)),
* [pre-commit hooks](.github/workflows/pre-commit.yaml)
(see current status [here](https://github.com/HighlanderLab/RcppTskit/actions/workflows/pre-commit.yaml)), and
* [test coverage](.github/workflows/test-coverage.yaml)
(see current status [here](https://github.com/HighlanderLab/RcppTskit/actions/workflows/test-coverage.yaml)).

[R universe for RcppTskit](https://highlanderlab.r-universe.dev/RcppTskit)
also provides another set of checks - see [here](https://highlanderlab.r-universe.dev/RcppTskit#checktable).
These are provided after new code is pushed or merged into this repository.
See [README_DEVEL.md](README_DEVEL.md)
Loading
Loading