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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
91 changes: 91 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contribution guide

This outlines how to propose a change to this repo.
For a detailed discussion on contributing to this and other tidyverse packages, please see the [development contributing guide](https://rstd.io/tidy-contrib) and our [code review principles](https://code-review.tidyverse.org/).

## Fixing typos

You can fix typos, spelling mistakes, or grammatical errors in the documentation directly using the GitHub web interface, as long as the changes are made in the _source_ file.
This generally means you'll need to edit [roxygen2 comments](https://roxygen2.r-lib.org/articles/roxygen2.html) in an `.R`, not a `.Rd` file.
You can find the `.R` file that generates the `.Rd` by reading the comment in the first line.

## Bigger changes

If you want to make a bigger change, it's a good idea to first file an issue and make sure someone from the team agrees that it’s needed.
If you’ve found a bug, please file an issue that illustrates the bug with a minimal
[reprex](https://www.tidyverse.org/help/#reprex) (this will also help you write a unit test, if needed).
See our guide on [how to create a great issue](https://code-review.tidyverse.org/issues/) for more advice.

### Pull request process

- Fork the repository and clone onto your computer. If you haven't done this before, we recommend using `usethis`.

- Install and load the `usethis` package with:

```
install.packages("usethis")

library("usethis")
```

- If you are outside our group and the repo is public, please fork this repo using:

```
usethis::create_from_github("JRaviLab/REPONAME", fork = TRUE)
```
- Install BiocManager from Bioconductor:

```
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.19")
```

- If this repository is a package, install other development dependencies and then ensure that the package passes R CMD check using `devtools`:

```
install.packages("devtools")

library("devtools")

devtools::install_dev_deps()

devtools::check()
```

_If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing._

- Create a Git branch for your pull request (PR). We recommend using:

```
usethis::pr_init("brief-description-of-change")
```

- Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser.
The title of your PR should briefly describe the change.
The body of your PR should contain `Fixes #issue-number`.

### Code style

- New code should follow the tidyverse [style guide](https://style.tidyverse.org).
You can use the [styler](https://CRAN.R-project.org/package=styler) package to apply these styles, but please don't restyle code that has nothing to do with your PR.
- Lint Your Code: Ensure your code adheres to our style guidelines by using [lintr](https://lintr.r-lib.org/):

```
install.packages("lintr")

library("lintr")

lintr::lint("path/to/your/file.R")
```

- We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for package documentation.

- We use [testthat](https://cran.r-project.org/package=testthat) for unit tests.
Contributions with test cases included are easier to accept.

## Code of Conduct

Please note that the this project is released with a
[Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this
project you agree to abide by its terms.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: "\U0001F41E[BUG]"
labels: bug
assignees: jananiravi

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Use code '...' (or add hyperlink)
2. Click on '...'
3. Scroll down to '...'
4. See error/issue

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g., iOS]
- Browser [e.g., chrome, safari]
- Version [e.g., 22]

**Smartphone (please complete the following information):**
- Device: [e.g., iPhone16]
- OS: [e.g., iOS8.1]
- Browser [e.g., stock browser, safari]
- Version [e.g., 22]

**Additional context**
Please add any other context about the problem here, along with screenshots, code snippets, possible fixes, and relevant information to help troubleshoot.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "\U0001F195 [FEAT]"
labels: enhancement
assignees: jananiravi

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. E.g., I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen and how you envision this. If you already have a solution, awesome 🙌 -- link to the branch/PR here.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- _modified from [EmbeddedArtistry](https://embeddedartistry.com/blog/2017/08/04/a-github-pull-request-template-for-your-projects/)_
_referenced with modifications from [pycytominer](https://github.com/cytomining/pycytominer/blob/master/.github/PULL_REQUEST_TEMPLATE.md)_ -->

# Description

<!--
Thank you so much for your contribution to <NewPackage>!

Please _succinctly_ summarize your proposed change.
Namely, consider addressing the following questions:

- What motivated you to open this pull request?
- Were there any special adjustments you had to make to complete the work?
- Are there any issues, which are related to this pull request (you may use a `#<digit>` to reference GitHub issues as links within this description)?

GHA exist for linting and styling
- https://github.com/r-lib/actions/blob/v2/examples/lint-project.yaml
- https://github.com/r-lib/actions/blob/v2/examples/style.yaml
-->

## What kind of change(s) are included?

- [ ] Feature (adds or updates new capabilities)
- [ ] Bug fix (fixes an issue).
- [ ] Enhancement (adds functionality).
- [ ] Breaking change (these changes would cause existing functionality to not work as expected).

# Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

- [ ] I have read and followed the [CONTRIBUTING.md](CONTRIBUTING.md) guidelines.
- [ ] I have searched for existing content to ensure this is not a duplicate. I have deduplicated my codebase.
- [ ] I have performed a self-review of these additions (including spelling, grammar, and related).
- [ ] I have implemented basic code linting, styling, and indentation (e.g., with lintr, styler).
- [ ] I have added comments to my code to help provide understanding.
- [ ] I have added a test which covers the code changes found within this PR.
- [ ] I have added necessary data (or sample data) to test run these scripts.
- [ ] **Reviewer assignment**: Tag a relevant team member to review and approve the changes.
32 changes: 32 additions & 0 deletions .github/workflows/lint-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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:

name: lint-project.yaml

permissions: read-all

jobs:
lint-project:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

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

- name: Install lintr
run: install.packages("lintr")
shell: Rscript {0}

- name: Lint root directory
run: lintr::lint_dir()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
91 changes: 91 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# 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
name: style.yaml

on:
push:
branches:
- main
paths:
- "**.[rR]"
- "**.[qrR]md"
- "**.[rR]markdown"
- "**.[rR]nw"
- "**.[rR]profile"

pull_request:
paths:
- "**.[rR]"
- "**.[qrR]md"
- "**.[rR]markdown"
- "**.[rR]nw"
- "**.[rR]profile"

permissions: read-all

jobs:
style:
runs-on: ubuntu-latest
permissions:
contents: write
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref || github.ref_name }}

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

- name: Install styler, biocthis, and roxygen2
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: styler, biocthis, roxygen2

- name: Enable styler cache
run: styler::cache_activate()
shell: Rscript {0}

- name: Determine cache location
id: styler-location
run: |
cat(
"location=",
styler::cache_info(format = "tabular")$location,
"\n",
file = Sys.getenv("GITHUB_OUTPUT"),
append = TRUE,
sep = ""
)
shell: Rscript {0}

- name: Cache styler
uses: actions/cache@v4
with:
path: ${{ steps.styler-location.outputs.location }}
key: ${{ runner.os }}-styler-${{ github.sha }}
restore-keys: |
${{ runner.os }}-styler-
${{ runner.os }}-

- name: Style
run: styler::style_dir(transformers = biocthis::bioc_style())
shell: Rscript {0}

- name: Commit and push changes
run: |
FILES_TO_COMMIT=$(git diff --name-only | egrep -i '\.(r|[qr]md|rmarkdown|rnw|rprofile)$' || true)
if [ -n "$FILES_TO_COMMIT" ]; then
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add $FILES_TO_COMMIT
git commit -m "Style code (GHA)"
git push origin HEAD:${{ github.head_ref || github.ref_name }}
else
echo "No changes to commit."
fi
Loading