Skip to content

Commit d0a7d89

Browse files
Update lintr workflow
1 parent 1b5aa91 commit d0a7d89

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/lint.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: lint
2-
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
55
branches: [main, master, development]
66
pull_request:
7-
branches: [main, master, development]
7+
8+
name: lint.yaml
9+
10+
permissions: read-all
811

912
jobs:
1013
lint:
@@ -20,8 +23,11 @@ jobs:
2023

2124
- uses: r-lib/actions/setup-r-dependencies@v2
2225
with:
23-
extra-packages: lintr, local::.
26+
extra-packages: any::lintr, local::.
27+
needs: lint
2428

2529
- name: Lint
2630
run: lintr::lint_package()
2731
shell: Rscript {0}
32+
env:
33+
LINTR_ERROR_ON_LINT: true

R/use_afcharts.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
#' @export
2727

2828

29-
use_afcharts <- function(default_colour = afcharts::af_colour_values["dark-blue"],
30-
...) {
29+
use_afcharts <- function(
30+
default_colour = afcharts::af_colour_values["dark-blue"],
31+
...) {
3132

3233
# Use afcharts theme ----
3334

@@ -53,7 +54,7 @@ use_afcharts <- function(default_colour = afcharts::af_colour_values["dark-blue"
5354

5455
# Update default values with those passed to use_afcharts
5556
new_values <- c(...)
56-
for (i in 1:length(new_values)) {
57+
for (i in seq_along(new_values)) {
5758
default <- replace(default,
5859
which(names(default) == names(new_values)[i]),
5960
new_values[i])

0 commit comments

Comments
 (0)