Skip to content

Commit

Permalink
Add package sticker
Browse files Browse the repository at this point in the history
Closes #1188
  • Loading branch information
IndrajeetPatil committed Jan 14, 2024
1 parent bad1632 commit e726c16
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
^vignettes/[^-]+.gif$
^CRAN-SUBMISSION$
^CODE_OF_CONDUCT\.md$
^inst/hextools$
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# lintr
# `{lintr}`: A 'Linter' for R Code

[![R build status](https://github.com/r-lib/lintr/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/lintr/actions)
[![codecov.io](https://codecov.io/gh/r-lib/lintr/branch/main/graphs/badge.svg)](https://app.codecov.io/gh/r-lib/lintr?branch=main)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/lintr)](https://cran.r-project.org/package=lintr)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)

`{lintr}` provides [static code analysis for R](https://en.wikipedia.org/wiki/Static_program_analysis). It checks for adherence to a given style, identifying syntax errors and possible semantic issues, then reports them to you so you can take action. Watch lintr in action in the following animation:
## Overview <img src="man/figures/logo.png" align="right" width="200" />

`{lintr}` provides [static code analysis for R](https://en.wikipedia.org/wiki/Static_program_analysis). It checks for adherence to a given style, identifying syntax errors and possible semantic issues, then reports them to you so you can take action.

Watch `{lintr}` in action in the following animation:

![](man/figures/demo.gif "lintr demo")

Expand Down Expand Up @@ -69,3 +73,9 @@ Without further configuration, this will run the [default linters](https://lintr
## Code of Conduct

Please note that the lintr project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). By contributing to this project, you agree to abide by its terms.

## Acknowledgments

Hex sticker font is [IBM Plex Serif](https://fonts.google.com/specimen/IBM+Plex+Serif), and
the image is taken from icon made by [Freepik](https://www.freepik.com) and
available at [flaticon.com](https://www.flaticon.com/free-icon/lint-roller_6981024).
45 changes: 45 additions & 0 deletions inst/hextools/hexsticker.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
library(hexSticker)

Check warning on line 1 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=1,col=1,[missing_package_linter] Package 'hexSticker' is not installed.
library(magick)

Check warning on line 2 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=2,col=1,[missing_package_linter] Package 'magick' is not installed.
library(showtext)

Check warning on line 3 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=3,col=1,[missing_package_linter] Package 'showtext' is not installed.
library(sysfonts)

Check warning on line 4 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=4,col=1,[missing_package_linter] Package 'sysfonts' is not installed.

# Loading Google fonts (http://www.google.com/fonts)
google_font_name <- "IBM Plex Serif"
font_add_google(google_font_name)

# Automatically use showtext to render text for future devices
showtext_auto()

project_root <- here::here()

Check warning on line 13 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=13,col=17,[namespace_linter] Package 'here' is not installed.

# https://www.flaticon.com/free-icon/lint-roller_6981024
image <- image_read(file.path(project_root, "inst", "hextools", "lint-roller.png"))
manual_logo_path <- file.path(project_root, "man", "figures", "logo.png")

sticker(
# image
subplot = image,
s_x = 1,

Check warning on line 22 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=22,col=10,[implicit_integer_linter] Use 1L or 1.0 to avoid implicit integers.
s_y = 0.85,
s_width = 0.9,
s_height = 0.9,
# package name
package = "lintr",
p_color = "#545452",
p_family = google_font_name,
p_size = 45,

Check warning on line 30 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=30,col=14,[implicit_integer_linter] Use 45L or 45.0 to avoid implicit integers.
p_x = 1,

Check warning on line 31 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=31,col=10,[implicit_integer_linter] Use 1L or 1.0 to avoid implicit integers.
p_y = 1.55,
# border
h_color = "grey",
h_fill = "white",
# url
url = " https://lintr.r-lib.org/",
u_size = 10,

Check warning on line 38 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=38,col=14,[implicit_integer_linter] Use 10L or 10.0 to avoid implicit integers.
u_color = "grey",
# saving sticker
dpi = 600,

Check warning on line 41 in inst/hextools/hexsticker.R

View workflow job for this annotation

GitHub Actions / lint

file=inst/hextools/hexsticker.R,line=41,col=12,[implicit_integer_linter] Use 600L or 600.0 to avoid implicit integers.
filename = manual_logo_path
)

pkgdown::build_favicons()
Binary file added inst/hextools/lint-roller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-152x152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-60x60.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon-76x76.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pkgdown/favicon/favicon.ico
Binary file not shown.

0 comments on commit e726c16

Please sign in to comment.