{"id":28429725,"url":"https://github.com/appsilon/box.linters","last_synced_at":"2025-07-17T00:34:05.832Z","repository":{"id":235729971,"uuid":"791109040","full_name":"Appsilon/box.linters","owner":"Appsilon","description":"lintr-compatible linters for box modules in R","archived":false,"fork":false,"pushed_at":"2025-07-15T07:19:07.000Z","size":2476,"stargazers_count":10,"open_issues_count":24,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-15T16:50:07.612Z","etag":null,"topics":["box","linter","r","rhinoverse","shiny"],"latest_commit_sha":null,"homepage":"https://appsilon.github.io/box.linters/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Appsilon.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-24T05:39:42.000Z","updated_at":"2025-07-15T07:14:46.000Z","dependencies_parsed_at":"2024-05-28T07:04:20.091Z","dependency_job_id":"de22513e-d091-4be9-8e9f-9ae747aa798c","html_url":"https://github.com/Appsilon/box.linters","commit_stats":null,"previous_names":["appsilon/box.linters"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Appsilon/box.linters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fbox.linters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fbox.linters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fbox.linters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fbox.linters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Appsilon","download_url":"https://codeload.github.com/Appsilon/box.linters/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Appsilon%2Fbox.linters/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265554803,"owners_count":23787280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["box","linter","r","rhinoverse","shiny"],"created_at":"2025-06-05T13:39:01.125Z","updated_at":"2025-07-17T00:34:05.812Z","avatar_url":"https://github.com/Appsilon.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# box.linters \u003ca href=\"https://appsilon.github.io/box.linters/\"\u003e\u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"box.linters logo\" style=\"height: 140px;\"\u003e\u003c/a\u003e\n\n\u003e _lintr-compatible linters for box modules in R_\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/box.linters)](https://cran.r-project.org/package=box.linters)\n[![R-CMD-check](https://github.com/Appsilon/box.linters/workflows/CI/badge.svg)](https://github.com/Appsilon/box.linters/actions/workflows/ci.yml)\n[![Codecov test coverage](https://codecov.io/gh/Appsilon/box.linters/branch/main/graph/badge.svg)](https://app.codecov.io/gh/Appsilon/box.linters)\n\u003c!-- badges: end --\u003e\n\n`box.linters` is an R package that provides the [`{lintr}` package](https://github.com/r-lib/lintr/) compatibility with [`{box}` package](https://github.com/klmr/box) modules. In addition to providing code-styling checks for `box::use()` function calls, `box.linters` includes a collection of linter functions to replace [`lintr::object_usage_linter()`](https://lintr.r-lib.org/reference/object_usage_linter.html).\n\nWhile the primary purpose of `{box.linters}` is for use with the  [`{rhino}`](https://appsilon.github.io/rhino/) package, its functions and features are available for use with any R code or project that uses the `{box}` package for modular R code.\n\n## Motivation\n\n`lintr::object_usage_linter` is not compatible with `{box}` modules.\n\n```r\n# use of box modules\nbox::use(\n  stringr[...]\n)\n\nsome_function \u003c- function() {\n  str_trim(\"  String with trailing and leading white space\\t\")\n}\n```\n\n```\n\u003e lintr::lint(box-module.R)\n\u003ctext\u003e:6:3: warning: [object_usage_linter] no visible global function definition for 'str_trim'\n  str_trim(\"  String with trailing and leading white space \")\n  ^~~~~~~~\n```\n\nIn order to use `lintr` and `box` together, it was necessary to disable `lintr::object_usage_linter()`:\n\n```r\nlintr::lint(box-module.R,\n            linters = lintr::linters_with_defaults(object_usage_linter = NULL))\n```\n\nHowever, this meant we lose the functionality provided by `lintr::object_usage_linter()`.\n\n## Installation\n\nStable version:\n\n```r\ninstall.packages(\"box.linters\")\n```\n\nDevelopment version:\n\n```r\n# install.packages(\"remotes\")\nremotes::install_github(\"Appsilon/box.linters\")\n```\n\n## Usage\n\nCreate a configuration file and run selected linters:\n\n### .lintr setup\n\n```r\n# create a .lintr file\nbox.linters::use_box_lintr()\n\n# a file:\nlintr::lint(filename.R)\n\n# in a project:\nlintr::lint_dir()\n```\n\n### Manually\n\nOr, use `box.linters` manually with `lintr`:\n\n```r\n# a file:\nlintr::lint(filename.R, linters = box.linters::box_default_linters)\n\n# in a project:\nlintr::lint_dir(linters = box.linters::box_default_linters)\n```\n\n### Rhino\n\nOr, use `box.linters` from within a `{rhino}` project:\n\n```r\n# a .lintr file should already exist when a rhino project is created\n# box.linters::use_box_lintr(type = \"rhino\")\n\n# in a rhino project:\nrhino::lint_r()\n```\n\n## {glue} String Interpolation\n\n`{box.linters}` also looks inside `{glue}` strings. The default opening and closing delimiters are \"`{`\" and \"`}`\". `{glue}` provides a way to [customize delimiters](https://glue.tidyverse.org/reference/glue.html). Support for custom `{glue}` delimiters are provided *project-wide* by setting `glue.open` and `glue.close` options in the following manner:\n\n```r\noptions(\n  list(\n    glue.open = \"\u003c\u003c\",\n    glue.close = \"\u003e\u003e\"\n  )\n)\n```\n\nThis is consistent with [`glue::glue()`](https://glue.tidyverse.org/reference/glue.html), doubling the full delimiter escapes it.\n\nBecause setting `glue.open` and `glue.close` will be *global* or *project-wide*, it is advised to invoke `glue` in the following manner to avoid confusion:\n\n```r\nglue::glue(..., .open = getOption(\"glue.open\"), .close = getOption(\"glue.close\"))\n```\n\n## Contribute\n\nIf you want to contribute to this project, please submit a regular PR, once you're done with the new feature or bug fix.\n\nReporting a bug is also helpful - please use [Github issues](https://github.com/Appsilon/box.linters/issues) and describe your problem as detailed as possible.\n\n## Appsilon\n\n\u003cimg src=\"https://avatars0.githubusercontent.com/u/6096772\" align=\"right\" alt=\"\" width=\"6%\" /\u003e\n\nAppsilon is a **Posit (formerly RStudio) Full Service Certified Partner**.\u003cbr/\u003e\nLearn more at [appsilon.com](https://appsilon.com).\n\nGet in touch [opensource@appsilon.com](mailto:opensource@appsilon.com)\n\nExplore the [Rhinoverse](https://rhinoverse.dev) - a family of R packages built around [Rhino](https://appsilon.github.io/rhino/)!\n\n\u003ca href = \"https://appsilon.us16.list-manage.com/subscribe?u=c042d7c0dbf57c5c6f8b54598\u0026id=870d5bfc05\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/Appsilon/website-cdn/gh-pages/shiny_weekly_light.jpg\" alt=\"Subscribe for Shiny tutorials, exclusive articles, R/Shiny community events, and more.\"/\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsilon%2Fbox.linters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappsilon%2Fbox.linters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappsilon%2Fbox.linters/lists"}