Skip to content

Commit

Permalink
Merge pull request #38 from best-practice-and-impact/lint_issue
Browse files Browse the repository at this point in the history
fixed all lint warnings
  • Loading branch information
Olivia-Box-Power authored Nov 22, 2024
2 parents 2330210 + d0a7d89 commit 3d6f60d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: lint

# 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]
branches: [main, master, development]
pull_request:
branches: [main, master]

name: lint.yaml

permissions: read-all

jobs:
lint:
Expand All @@ -20,8 +23,11 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: lintr, local::.
extra-packages: any::lintr, local::.
needs: lint

- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
7 changes: 4 additions & 3 deletions R/use_afcharts.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
#' @export


use_afcharts <- function(default_colour = afcharts::af_colour_values["dark-blue"],
...) {
use_afcharts <- function(
default_colour = afcharts::af_colour_values["dark-blue"],
...) {

# Use afcharts theme ----

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

# Update default values with those passed to use_afcharts
new_values <- c(...)
for (i in 1:length(new_values)) {
for (i in seq_along(new_values)) {
default <- replace(default,
which(names(default) == names(new_values)[i]),
new_values[i])
Expand Down
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ save_govuk <- function(filename,

device <- match.arg(device)

if (device == "svg"){
if (device == "svg") {
width <- 960 / 72
height <- 640 / 72
units <- "in"
Expand Down
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ ex2_alt <- paste("A bar chart with white background,",
# afcharts <img src="man/figures/logo.svg" alt="afcharts logo" align="right" height="150"/>

<!-- badges: start -->

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/best-practice-and-impact/afcharts)](https://github.com/best-practice-and-impact/afcharts/releases/latest) [![R build status](https://github.com/best-practice-and-impact/afcharts/workflows/R-CMD-check/badge.svg)](https://github.com/best-practice-and-impact/afcharts/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/afcharts)](https://CRAN.R-project.org/package=afcharts)
[![R-CMD-check](https://github.com/best-practice-and-impact/afcharts/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/best-practice-and-impact/afcharts/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@

<!-- badges: start -->

[![GitHub release (latest by
date)](https://img.shields.io/github/v/release/best-practice-and-impact/afcharts)](https://github.com/best-practice-and-impact/afcharts/releases/latest)
[![R build
status](https://github.com/best-practice-and-impact/afcharts/workflows/R-CMD-check/badge.svg)](https://github.com/best-practice-and-impact/afcharts/actions)
[![CRAN
status](https://www.r-pkg.org/badges/version/afcharts)](https://CRAN.R-project.org/package=afcharts)
[![R-CMD-check](https://github.com/best-practice-and-impact/afcharts/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/best-practice-and-impact/afcharts/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

Expand Down Expand Up @@ -104,7 +102,6 @@ gapminder |>

``` r
afcharts::use_afcharts()
#> NULL

gapminder |>
filter(year == 2007 & continent == "Europe") |>
Expand Down
1 change: 0 additions & 1 deletion vignettes/colours.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ afcharts::af_colour_palettes
# View names and hex codes for `main` colour palette
afcharts::af_colour_palettes$main
```

Examples of how to apply these palettes to ggplot2 charts are available in both the [cookbook](https://best-practice-and-impact.github.io/afcharts/articles/cookbook.html) and the reference files for `scale_` [colour functions](https://best-practice-and-impact.github.io/afcharts/reference/index.html#colours).
2 changes: 1 addition & 1 deletion vignettes/cookbook/_customisations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ limits_pretty <- function(x, ...) range(pretty(x, ...))
last_plot() +
scale_x_continuous(expand = expansion(mult = c(0, .1)),
breaks = pretty,
breaks = pretty,
limits = limits_pretty)
```
Expand Down

0 comments on commit 3d6f60d

Please sign in to comment.