Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds pre-commit hook for markdownlint-cli2 and lints existing code base #195

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
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 .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"r.rterm.linux": "/usr/bin/R",
"terminal.integrated.sendKeybindingsToShell": true,
"svn.multipleFolders.enabled": true,
"workbench.editorAssociations": {
"workbench.editorAssociations": {
"*.md": "vscode.markdown.preview.editor"
},
"workbench.welcomePage.walkthroughs.openOnInstall": false
Expand Down
17 changes: 9 additions & 8 deletions .github/ISSUE_TEMPLATE/release-new-version-of-devcontainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ assignees: ''

Checklist for release:

- [ ] Update NEWS file
- [ ] Update CITATION.cff
- [ ] Update VERSION
- [ ] In devcontainer.json, update `"image": "ghcr.io/r-devel/r-dev-env:devel"` to `"image": "ghcr.io/r-devel/r-dev-env:main"`,,
- [ ] Make PR to main branch - needs approving review!
- [ ] Make sure docker container is rebuilt
- [ ] Test container and fix any issues
- [ ] Make GitHub release
- [ ] Update NEWS file
- [ ] Update CITATION.cff
- [ ] Update VERSION
- [ ] In devcontainer.json, update `"image": "ghcr.io/r-devel/r-dev-env:devel"`
to `"image": "ghcr.io/r-devel/r-dev-env:main"`,,
- [ ] Make PR to main branch - needs approving review!
- [ ] Make sure docker container is rebuilt
- [ ] Test container and fix any issues
- [ ] Make GitHub release
60 changes: 42 additions & 18 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,64 @@
# R Dev Container
![Release](https://img.shields.io/github/v/release/r-devel/r-dev-env)

![Release](https://img.shields.io/github/v/release/r-devel/r-dev-env)

The aim of the R Dev Container is to provide a standard environment for the exploration and development of the R source code. A prototype was developed under Google Summer of Code 2023 and development is continuing under Google Summer of Code 2024.
The aim of the R Dev Container is to provide a standard environment for the
exploration and development of the R source code. A prototype was developed
under Google Summer of Code 2023 and development is continuing under Google
Summer of Code 2024.

## Getting started

### Run in a web browser with GitHub Codespace

Click on the button below followed by "Create Codespace" to create and enter your own web based containerised develoment environment.
Click on the button below followed by "Create Codespace" to create and enter
your own web based containerised develoment environment.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=647768262&machine=premiumLinux&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)
[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=647768262&machine=premiumLinux&devcontainer_path=.devcontainer%2Fdevcontainer.json&location=WestUs2)

The [Starting Codespace section](https://contributor.r-project.org/r-dev-env/container_setup/creating_codespace/) of the R Dev Container Docs will walk you through the process. Then you can work through the tutorials in the docs to lean how to use the codespace for R development.
The [Starting Codespace
section](https://contributor.r-project.org/r-dev-env/container_setup/creating_codespace/)
of the R Dev Container Docs will walk you through the process. Then you can work
through the tutorials in the docs to lean how to use the codespace for R
development.

More details about GitHub codespaces can be found in the [GitHub Codespaces Docs](https://docs.github.com/en/codespaces/overview). GitHub currently offers up to 60 hours for free on dual core codespaces.
More details about GitHub codespaces can be found in the [GitHub Codespaces
Docs](https://docs.github.com/en/codespaces/overview). GitHub currently offers
up to 60 hours for free on dual core codespaces.

### Run on your local computer

The R Dev Container can also be run locally on your computer.
Running the environment requires you to have Docker, VSCode, and the VSCode Dev Containers extension installed.
Upon opening a copy of the [r-dev-env repository](https://github.com/r-devel/r-dev-env) in VSCode you will be prompted to start the dev container.
The R Dev Container can also be run locally on your computer. Running the
environment requires you to have Docker, VSCode, and the VSCode Dev Containers
extension installed. Upon opening a copy of the [r-dev-env
repository](https://github.com/r-devel/r-dev-env) in VSCode you will be prompted
to start the dev container.

The [Local setup section](https://contributor.r-project.org/r-dev-env/tutorials/localsetup/) of the R Dev Container Docs will walk you through the process.
Then you can work through the following the tutorials in the docs to learn how to use the codespace for R development.
The [Local setup
section](https://contributor.r-project.org/r-dev-env/tutorials/localsetup/) of
the R Dev Container Docs will walk you through the process. Then you can work
through the following the tutorials in the docs to learn how to use the
codespace for R development.

More information about Dev Containers can be found in the [Microsoft Documentation](https://code.visualstudio.com/docs/devcontainers/containers).
More information about Dev Containers can be found in the [Microsoft
Documentation](https://code.visualstudio.com/docs/devcontainers/containers).

## Project Background

The standard development process used by members of the R Core Team involves an iterative process of making changes to the source code, re-building R and exploring/testing the changes made.
This process presents a big hurdle for new contributors to R, as setting up their system to build R can be non-trivial, requiring a lot of trouble-shooting, especially on Windows and macOS.
On Linux and macOS, it is not straight-forward to work with different versions of R side-by-side and care needs to be taken not to corrupt or over-write the user's existing version of R/R packages.

For these reasons, we propose to create containerized development environments for R.
Our focus will be on creating a complete environment, including an IDE, that will provide a familiar space for R developers to work on contributions to base R.
The standard development process used by members of the R Core Team involves an
iterative process of making changes to the source code, re-building R and
exploring/testing the changes made. This process presents a big hurdle for new
contributors to R, as setting up their system to build R can be non-trivial,
requiring a lot of trouble-shooting, especially on Windows and macOS. On Linux
and macOS, it is not straight-forward to work with different versions of R
side-by-side and care needs to be taken not to corrupt or over-write the user's
existing version of R/R packages.

For these reasons, we propose to create containerized development environments
for R. Our focus will be on creating a complete environment, including an IDE,
that will provide a familiar space for R developers to work on contributions to
base R.

## Contributors

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-and-publish-image.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow uses actions that are not certified by GitHub.
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# documentation.

name: Build and publish Docker image

Expand All @@ -15,7 +15,7 @@ on:
- 'Dockerfile'
- 'reinstall-cmake.sh'
- 'VERSION'


env:
REGISTRY: ghcr.io
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-gitpod-image.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow uses actions that are not certified by GitHub.
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# documentation.

name: Build and publish Gitpod Docker image

Expand All @@ -16,7 +16,7 @@ on:
- '.gitpod.yml'
- 'reinstall-cmake.sh'
- 'VERSION'


env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-mkdocs-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
python-version: 3.x

- name: Install dependencies
run: pip install mkdocs mkdocs-material[imaging]
Expand Down
23 changes: 23 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
config:

# MD013 - line-length
line_length:
line_length: 80
code_blocks: false
tables: false
html:
allowed_elements:
- div
- figure
# MD029 - ol-prefix disabled as ordered lists are interspersed wit code in multiple places
ol-prefix: false
# MD041 - first-line-heading disable due to splitting of sections across multiple files
first-line-h1: false

globs:

- "docs/**/*.md"
- "*.md"


fix: true
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.13.0
hooks:
- id: markdownlint-cli2
args: []

ci:
autofix_prs: true
autofix_commit_msg: '[pre-commit.ci] Fixing issues with pre-commit'
autoupdate_schedule: weekly
autoupdate_commit_msg: '[pre-commit.ci] pre-commit-autoupdate'
skip: [] # Optionally list ids of hooks to skip on CI
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ authors:
given-names: James
- family-name: Emsley
given-names: Iain

title: "R Development Container"
version: 0.3.0
doi:
doi:
date-released: 04-09-2024
8 changes: 4 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ reporter of any incident.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version
[1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and
[2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md),
and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/)
, version [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md)
and [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md)
, and was generated by [contributing-gen](https://github.com/bttger/contributing-gen).
Loading