Skip to content

Commit

Permalink
add superlinter #16
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Feb 18, 2021
1 parent 98360b9 commit f5f4c96
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 5 deletions.
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)
14 changes: 13 additions & 1 deletion R/testing.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Set up codecov
#' @param reposlug `[character(1)]`
#' giving the `username/repo` URL slug of the project.
#' @family testing functions
#' @family quality control functions
#' @export
use_codecov2 <- function(reposlug) {
usethis::use_coverage(type = "codecov")
Expand All @@ -12,3 +12,15 @@ use_codecov2 <- function(reposlug) {
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)
}
6 changes: 5 additions & 1 deletion 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

0 comments on commit f5f4c96

Please sign in to comment.