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

add super linter #190

Open
wants to merge 5 commits into
base: master
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
55 changes: 55 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
###########################
###########################
## Linter GitHub Actions ##
###########################
###########################
name: Lint Code Base

#
# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [master]
# Remove the line above to run when pushing to master
pull_request:
branches: [master]

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
# Load all steps #
##################
steps:
##########################
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

################################
# Run Linter against code base #
################################
- name: Lint Code Base
uses: github/super-linter@v3
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export(remove_dep)
export(use_codecov2)
export(use_onbuild_image)
export(use_radian)
export(use_superlinter)
export(view_url)
24 changes: 19 additions & 5 deletions R/testing.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
#' Set up codecov
#' @param reposlug `[character(1)]` giving the `username/repo` URL slug of the project.
#' @family testing functions
#' @param reposlug `[character(1)]`
#' giving the `username/repo` URL slug of the project.
#' @family quality control functions
#' @export
use_codecov2 <- function(reposlug) {
usethis::use_coverage(type = "codecov")
usethis::ui_todo(
"Add the {usethis::ui_value('Repository Upload Token')} from codecov as a secret called {usethis::ui_value('CODECOV_TOKEN')} on GitHub."
)
usethis::ui_todo(c(
"Add the {usethis::ui_value('Repository Upload Token')} from codecov ",
"as a secret called {usethis::ui_value('CODECOV_TOKEN')} on GitHub."
))
view_url("https://codecov.io/gh", reposlug, "settings")
view_url("https://github.com", reposlug, "settings", "secrets")
}

#' Set up [super-linter](https://github.com/github/super-linter)
#' @family quality control functions
#' @export
use_superlinter <- function() {
superlinter_url <- "https://github.com/marketplace/actions/super-linter"
usethis::ui_todo(c(
"Please add the {usethis::ui_code{'linter.yaml'} ",
"as described on {usethis::ui_code{superlinter_url}."
))
view_url(superlinter_url)
}
9 changes: 7 additions & 2 deletions man/use_codecov2.Rd

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

16 changes: 16 additions & 0 deletions man/use_superlinter.Rd

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

6 changes: 3 additions & 3 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ reference:
Setting up RStudio and vscode.
- contents:
- has_concept("editor functions")
- subtitle: Testing
- subtitle: Quality Control
desc: >
Set up unit testing.
Set up testing and linting.
- contents:
- has_concept("testing functions")
- has_concept("quality control functions")
- subtitle: Deployment
desc: >
Deploy muggle projects to the public cloud.
Expand Down