diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml deleted file mode 100644 index 0b26021..0000000 --- a/.github/workflows/pkgdown.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# 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] - pull_request: - branches: [main, master] - release: - types: [published] - workflow_dispatch: - -name: pkgdown - -jobs: - pkgdown: - runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::pkgdown, local::. - needs: website - - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) - shell: Rscript {0} - - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - clean: false - branch: gh-pages - folder: docs diff --git a/DESCRIPTION b/DESCRIPTION index 746e574..f77e5b0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: goodpractice Title: Advice on R Package Building -Version: 1.0.4.010 +Version: 1.0.4.012 Authors@R: c( person(given = "Mark", diff --git a/codemeta.json b/codemeta.json index f8ae0e5..99609b9 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,7 +8,7 @@ "codeRepository": "https://github.com/ropensci-review-tools/goodpractice", "issueTracker": "https://github.com/ropensci-review-tools/goodpractice/issues", "license": "https://spdx.org/licenses/MIT", - "version": "1.0.4.010", + "version": "1.0.4.012", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 6cc38c1..0000000 --- a/docs/404.html +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - -Page not found (404) • goodpractice - - - - - - - - - - - - - - - - - - -
-
- - - - -
-
- - -Content not found. Please use links in the navbar. - -
- - - -
- - - - -
- - - - - - - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html deleted file mode 100644 index 2fbaf1c..0000000 --- a/docs/LICENSE-text.html +++ /dev/null @@ -1,92 +0,0 @@ - -License • goodpractice - - -
-
- - - -
-
- - -
YEAR: 2021
-COPYRIGHT HOLDER: Mango Solutions
-
- -
- - - -
- - - -
- - - - - - - - diff --git a/docs/LICENSE.html b/docs/LICENSE.html deleted file mode 100644 index e9251c6..0000000 --- a/docs/LICENSE.html +++ /dev/null @@ -1,95 +0,0 @@ - -MIT License • goodpractice - - -
-
- - - -
-
- - -
-

Copyright (c) 2021 Mango Solutions

-

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

-

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

-

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-
- -
- - - -
- - - -
- - - - - - - - diff --git a/docs/apple-touch-icon-120x120.png b/docs/apple-touch-icon-120x120.png deleted file mode 100644 index dc28b72..0000000 Binary files a/docs/apple-touch-icon-120x120.png and /dev/null differ diff --git a/docs/apple-touch-icon-152x152.png b/docs/apple-touch-icon-152x152.png deleted file mode 100644 index f5a1924..0000000 Binary files a/docs/apple-touch-icon-152x152.png and /dev/null differ diff --git a/docs/apple-touch-icon-180x180.png b/docs/apple-touch-icon-180x180.png deleted file mode 100644 index 53c2b53..0000000 Binary files a/docs/apple-touch-icon-180x180.png and /dev/null differ diff --git a/docs/apple-touch-icon-60x60.png b/docs/apple-touch-icon-60x60.png deleted file mode 100644 index dc86734..0000000 Binary files a/docs/apple-touch-icon-60x60.png and /dev/null differ diff --git a/docs/apple-touch-icon-76x76.png b/docs/apple-touch-icon-76x76.png deleted file mode 100644 index cbf8e50..0000000 Binary files a/docs/apple-touch-icon-76x76.png and /dev/null differ diff --git a/docs/apple-touch-icon.png b/docs/apple-touch-icon.png deleted file mode 100644 index c7f7774..0000000 Binary files a/docs/apple-touch-icon.png and /dev/null differ diff --git a/docs/articles/custom_checks.html b/docs/articles/custom_checks.html deleted file mode 100644 index 666bc68..0000000 --- a/docs/articles/custom_checks.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - - - -Custom Checks • goodpractice - - - - - - - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -

By default, the goodpractice() function and its alias gp() run all the checks available in the package (use all_checks() to show all checks implemented). In addition, users can provide their own custom checks.

-
-

What’s happening inside of gp()? -

-

The gp() function essentially carries out two types of steps:

-
    -
  • First, it runs preparation steps for the checks, such as calculating test coverage or cyclomatic complexity.
  • -
  • Then it carries out the checks, e.g., if cyclomatic complexity exceeds a threshold.
  • -
-

The results of the preparation steps and the checks are added to the return object, also referred to as the state. The print method accesses the check results and prints the advice for the failed checks - or praise if none fail.

-
-
-

Writing custom checks -

-
-

Checks without corresponding preparation steps -

-

Custom checks can be created with the make_check() function. As inputs it takes a short description of the check, the check itself, and the gp advice to be given in case the check fails. To illustrate this, let’s use a simplified version of the check on T and F instead of TRUE and FALSE.

-

The check argument is a function which takes the state as the input and carries out the check, returning TRUE if the check was successful. The state includes the path to the source code of the package and the checkTnF() function of the tools package can be used to check if T or F was used.

-
-library(goodpractice)
-
-# make a simple version of the T/F check
-check_simple_tf <- make_check(
-  
-  description = "TRUE and FALSE is used, not T and F",
-  gp = "avoid 'T' and 'F', use 'TRUE' and 'FALSE' instead.",
-  check = function(state) {
-      length(tools::checkTnF(dir = state$path)) == 0
-  }
-)
-

Additional checks can be used in gp() via the extra_checks argument. This should be a named list of check objects as returned by the make_check() function. All checks to be carried out, regardless of whether they are provided by the goodpractice package or custom checks, must be named in the checks argument to gp().

-

The check on T/F implemented in the package gives more helpful advice than this simplified version and returns which files contain T and F so let’s do a quick comparison and run both versions:

-
-# get path to example package
-pkg_path <- system.file("bad1", package = "goodpractice")
-gp(pkg_path, checks = c("simple_tf", "truefalse_not_tf"),
-   extra_checks = list(simple_tf = check_simple_tf))
-#> -- GP badpackage ---------------------------------------------------------------
-#> 
-#> It is good practice to
-#> 
-#>   <U+2716> avoid 'T' and 'F', use 'TRUE' and 'FALSE' instead.
-#>   <U+2716> avoid 'T' and 'F', as they are just variables which are set
-#>     to the logicals 'TRUE' and 'FALSE' by default, but are not reserved
-#>     words and hence can be overwritten by the user.  Hence, one should
-#>     always use 'TRUE' and 'FALSE' for the logicals.
-#> 
-#>     R/tf.R:NA:NA
-#>     R/tf.R:NA:NA
-#>     R/tf.R:NA:NA
-#>     R/tf.R:NA:NA
-#>     R/tf.R:NA:NA
-#>     ... and 4 more lines
-#> 
-#> --------------------------------------------------------------------------------
-
-
-

Including a preparation step -

-

Including a preparation step is optional but can be helpful if several checks require the same preparations upfront. In the following example we check for two different fields to be present in the DESCRIPTION file, the URL field and the BugReports field. Both checks can be carried out easily building on a preparation step with the desc package for handling DESCRIPTION files.

-

The checks are linked to the preparation via the prep name: it appears as the name argument to make_prep(), as the preps argument to make_check() and finally as the name in the list for the extra_preps argument to gp().

-
-# prep: process DESCRIPTION file
-desc_fun <- function(path, quiet) {
-  desc::description$new(path)
-}
-
-prep_desc <- make_prep(name = "desc", func = desc_fun)
-
-# check for an URL field
-check_url <- make_check(
-  description = "URL field in DESCRIPTION",
-  preps = "desc",
-  gp = "have a URL field in DESCRIPTION",
-  check = function(state) state$desc$has_fields("URL")
-)
-
-# check for a BugReport field
-check_bugreports <- make_check(
-  description = "BugReports in DESCRIPTION",
-  preps = "desc",
-  gp = "add a BugReports field to DESCRIPTION",
-  check = function(state) state$desc$has_fields('BugReports')
-)
-
-# run the two checks with their corresponding prep step
-gp(pkg_path, checks = c("url", "bugreports"),
-   extra_preps = list("desc" = prep_desc),
-   extra_checks = list("url" = check_url, "bugreports" = check_bugreports))
-#> Preparing: desc
-#> -- GP badpackage ---------------------------------------------------------------
-#> 
-#> It is good practice to
-#> 
-#>   <U+2716> have a URL field in DESCRIPTION
-#>   <U+2716> add a BugReports field to DESCRIPTION
-#> --------------------------------------------------------------------------------
-

More examples for using custom checks can be found in the rOpenSci unconf 2017 project checkers for automated checking of best practices for research compendia.

-
-
-
- - - -
- - - - -
- - - - - - - - diff --git a/docs/articles/goodpractice.html b/docs/articles/goodpractice.html deleted file mode 100644 index 4b0a931..0000000 --- a/docs/articles/goodpractice.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - - -goodpractice • goodpractice - - - - - - - - - - - - - - - - - - - -
-
- - - - -
-
- - - - -
-

What’s it for? -

-

Building an R package is a great way of encapsulating code, documentation and data in a single testable and easily distributable unit.

-

For a package to be distributed via CRAN, it needs to pass a set of checks implemented in R CMD check, such as: Is there minimal documentation, e.g., are all arguments of exported functions documented? Are all dependencies declared?

-

These checks are helpful in developing a solid R package but they don’t check for several other good practices. For example, a package does not need to contain any tests but is it good practice to include such. Following a coding standard helps readability. Avoiding overly complex functions reduces the risk of bugs. Including an URL for bug reports lets people more easily report bugs if they find any.

-

Tools for automatically checking several of these aspects already exist and the goodpractice package bundles the checks from rcmdcheck with code coverage through the covr package, source code linting via the lintr package and cyclomatic complexity via the cyclocomp package and augments it with some further checks on good practice for R package development such as avoiding T and F in favour of TRUE and FALSE. It provides advice on which practices to follow and which to avoid.

-

You can use goodpractice checks as a reminder for you and your colleagues - and if you have custom checks to run, you can make goodpractice run those as well! Please see the vignette “Custom Checks” for more details.

-
-
-

Good practice out of the box -

-
-

Main function -

-

The main function is goodpractice() and has an alias gp() which takes the path to the source code of a package as its first argument. The goodpractice package contains the source for a simple package which violates some good practices. We’ll use this for the examples.

-
library(goodpractice)
-
-# get path to example package
-pkg_path <- system.file("bad1", package = "goodpractice")
-
-# run gp() on it
-g <- gp(pkg_path)
-#> Preparing: covr
-#> Warning in MYPREPS[[prep]](state, quiet = quiet): Prep step for test coverage
-#> failed.
-#> Preparing: cyclocomp
-#> Skipping 1 packages not available: goodpractice
-#>   
-  
-  
-   checking for file 'C:\Users\daniel.debortoli\AppData\Local\Temp\Rtmp6XhRBV\remotesbaccca184\badpackage/DESCRIPTION' ...
-  
-   checking for file 'C:\Users\daniel.debortoli\AppData\Local\Temp\Rtmp6XhRBV\remotesbaccca184\badpackage/DESCRIPTION' ... 
-  
-
[32mv
[39m  
[38;5;247mchecking for file 'C:\Users\daniel.debortoli\AppData\Local\Temp\Rtmp6XhRBV\remotesbaccca184\badpackage/DESCRIPTION'
[39m
[36m
[39m
-#> 
-  
-  
-  
-
[38;5;247m-
[39m
[38;5;247m  
[39m
[38;5;247mpreparing 'badpackage':
[39m
[36m
[39m
-#>    checking DESCRIPTION meta-information ...
-  
-   checking DESCRIPTION meta-information ... 
-  
-
[32mv
[39m  
[38;5;247mchecking DESCRIPTION meta-information
[39m
[36m
[39m
-#> 
-  
-  
-  
-   checking vignette meta-information ...
-  
-   checking vignette meta-information ... 
-  
-
[32mv
[39m  
[38;5;247mchecking vignette meta-information
[39m
[36m
[39m
-#> 
-  
-  
-  
-
[38;5;247m-
[39m
[38;5;247m  
[39m
[38;5;247mchecking for LF line-endings in source and make files and shell scripts
[39m
[36m
[39m
-#> 
-  
-  
-  
-
[38;5;247m-
[39m
[38;5;247m  
[39m
[38;5;247mchecking for empty or unneeded directories
[39m
[36m
[39m
-#> 
-  
-  
-  
-
[38;5;247m-
[39m
[38;5;247m  
[39m
[38;5;247mbuilding 'badpackage_1.0.0.tar.gz'
[39m
[36m
[39m
-#> 
-  
-   
-#> 
-#> Preparing: description
-#> Preparing: lintr
-#> Preparing: namespace
-#> Preparing: rcmdcheck
-#> pdflatex not found! Not building PDF manual.
-
-# show the result
-g
-#> 
[33m-- GP badpackage ---------------------------------------------------------------
[39m
-#> 
-#> 
[1mIt is good practice to
[22m
-#> 
-#>   
[31m<U+2716>
[39m not use "Depends" in DESCRIPTION, as it can cause name
-#>     clashes, and poor interaction with other packages. Use "Imports"
-#>     instead.
-#>   
[31m<U+2716>
[39m omit "Date" in DESCRIPTION. It is not required and it gets
-#>     invalid quite often. A build date will be added to the package when
-#>     you perform `R CMD build` on it.
-#>   
[31m<U+2716>
[39m add a "URL" field to DESCRIPTION. It helps users find
-#>     information about your package online. If your package does not
-#>     have a homepage, add an URL to GitHub, or the CRAN package package
-#>     page.
-#>   
[31m<U+2716>
[39m add a "BugReports" field to DESCRIPTION, and point it to a
-#>     bug tracker. Many online code hosting services provide bug trackers
-#>     for free, https://github.com, https://gitlab.com, etc.
-#>   
[31m<U+2716>
[39m omit trailing semicolons from code lines. They are not
-#>     needed and most R coding standards forbid them
-#> 
-#>     
[34mR\semicolons.R
[39m:
[34m4
[39m:
[34m30
[39m
-#>     
[34mR\semicolons.R
[39m:
[34m5
[39m:
[34m29
[39m
-#>     
[34mR\semicolons.R
[39m:
[34m9
[39m:
[34m38
[39m
-#> 
-#>   
[31m<U+2716>
[39m not import packages as a whole, as this can cause name
-#>     clashes between the imported packages. Instead, import only the
-#>     specific functions you need.
-#>   
[31m<U+2716>
[39m fix this R CMD check ERROR: VignetteBuilder package not
-#>     declared: 'knitr' See section 'The DESCRIPTION file' in the
-#>     'Writing R Extensions' manual.
-#>   
[31m<U+2716>
[39m avoid 'T' and 'F', as they are just variables which are set
-#>     to the logicals 'TRUE' and 'FALSE' by default, but are not reserved
-#>     words and hence can be overwritten by the user.  Hence, one should
-#>     always use 'TRUE' and 'FALSE' for the logicals.
-#> 
-#>     
[34mR/tf.R
[39m:
[34mNA
[39m:
[34mNA
[39m
-#>     
[34mR/tf.R
[39m:
[34mNA
[39m:
[34mNA
[39m
-#>     
[34mR/tf.R
[39m:
[34mNA
[39m:
[34mNA
[39m
-#>     
[34mR/tf.R
[39m:
[34mNA
[39m:
[34mNA
[39m
-#>     
[34mR/tf.R
[39m:
[34mNA
[39m:
[34mNA
[39m
-#> 
[34m    ... and 4 more lines
-#> 
[39m
-#> 
[33m--------------------------------------------------------------------------------
[39m
-

So with this package, we’ve done a few things in the DESCRIPTION file for which there are reasons not to do them, have unnecessary trailing semicolons in the code and used T and F for TRUE and FALSE. The output of gp() tells you what you did that isn’t considered good practice and if it’s in the R code, it points you the location of your faux-pas. In general, the messages are supposed to not only point out to you what you might want to avoid but also why.

-

The above example tries to run all 230 checks available, to see the full list use all_checks(). If you only want to run a subset of the checks, e.g., the one on the URL field in the DESCRIPTION, you can specify the checks by name:

-
-# what is the name of the check?
-grep("url", all_checks(), value = TRUE)
-#> [1] "description_url"
-
-# run only this check
-g_url <- gp(pkg_path, checks = "description_url")
-#> Preparing: description
-
-g_url
-#> -- GP badpackage ---------------------------------------------------------------
-#> 
-#> It is good practice to
-#> 
-#>   <U+2716> add a "URL" field to DESCRIPTION. It helps users find
-#>     information about your package online. If your package does not
-#>     have a homepage, add an URL to GitHub, or the CRAN package package
-#>     page.
-#> --------------------------------------------------------------------------------
-
-
-

Doing more than just printing -

-

Apart from printing a goodPractice object as returned by gp() to access the advice, you can also access which checks were carried out and which of those failed:

-
-# which checks were carried out?
-checks(g_url)
-#> [1] "description_url"
-
-# which checks failed?
-failed_checks(g)
-#> [1] "no_description_depends"                
-#> [2] "no_description_date"                   
-#> [3] "description_url"                       
-#> [4] "description_bugreports"                
-#> [5] "lintr_trailing_semicolon_linter"       
-#> [6] "no_import_package_as_a_whole"          
-#> [7] "rcmdcheck_package_dependencies_present"
-#> [8] "truefalse_not_tf"
-

To access all the checks carried out with their results in a data frame, use results() on your goodPractice object.

-
-# show the first 5 checks carried out and their results
-results(g)[1:5,]
-#>                    check result
-#> 1                   covr     NA
-#> 2              cyclocomp   TRUE
-#> 3 no_description_depends  FALSE
-#> 4    no_description_date  FALSE
-#> 5        description_url  FALSE
-

Note that the code coverage could not be calculated. The corresponding check does not show up in the failed checks (because it was not carried out) and the result is NA. It is also possible to export the results to a JSON file with export_json().

-
-
-
- - - -
- - - - -
- - - - - - - - diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index 2e782cd..0000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,91 +0,0 @@ - -Articles • goodpractice - - -
-
- - - -
-
- - -
-

All vignettes

-

- -
Custom Checks
-
-
goodpractice
-
-
-
-
- - -
- - - - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index a179029..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,135 +0,0 @@ - -Authors and Citation • goodpractice - - -
-
- - - -
-
-
- - - -
  • -

    Mango Solutions. Copyright holder. -
    MangoTheCat

    -
  • -
  • -

    Ana Simmons. Author, maintainer. -
    anasimmons

    -
  • -
  • -

    Gabor Csardi. Author. -

    -
  • -
  • -

    Hannah Frick. Author. -

    -
  • -
  • -

    Owen Jones. Author. -
    owenjonesuob

    -
  • -
  • -

    Hannah Alexander. Author. -

    -
  • -
  • -

    Fabian Scheipl. Contributor. -
    fabian-s

    -
  • -
-
-
-

Citation

- Source: DESCRIPTION -
-
- - -

Simmons A, Csardi G, Frick H, Jones O, Alexander H (2022). -goodpractice: Advice on R Package Building. -R package version 1.0.3, https://github.com/mangothecat/goodpractice. -

-
@Manual{,
-  title = {goodpractice: Advice on R Package Building},
-  author = {Ana Simmons and Gabor Csardi and Hannah Frick and Owen Jones and Hannah Alexander},
-  year = {2022},
-  note = {R package version 1.0.3},
-  url = {https://github.com/mangothecat/goodpractice},
-}
- -
- -
- - - -
- - - - - - - - diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a85941..0000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573..0000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1..0000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504c..0000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/favicon-16x16.png b/docs/favicon-16x16.png deleted file mode 100644 index c155b97..0000000 Binary files a/docs/favicon-16x16.png and /dev/null differ diff --git a/docs/favicon-32x32.png b/docs/favicon-32x32.png deleted file mode 100644 index 2366ed9..0000000 Binary files a/docs/favicon-32x32.png and /dev/null differ diff --git a/docs/favicon.ico b/docs/favicon.ico deleted file mode 100644 index e2fd2fe..0000000 Binary files a/docs/favicon.ico and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 0143519..0000000 --- a/docs/index.html +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - - -Advice on R Package Building • goodpractice - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    -
    -
    - - -
    -

    Advice on R Package Building -

    -

    Give advice about good practices when building R packages. Advice includes functions and syntax to avoid, package structure, code complexity, code formatting, etc.

    -
    -
    -

    Installation -

    -

    You can install the release version from CRAN

    -
    -install.packages("goodpractice")
    -

    and the development version from GitHub

    -
    -source("https://install-github.me/MangoTheCat/goodpractice")
    -# or
    -# install.packages("devtools")
    -devtools::install_github("mangothecat/goodpractice") 
    -
    -
    -

    Usage -

    -
    -library(goodpractice)
    -gp("<my-package>")
    -
    -
    -

    Example -

    -
    -library(goodpractice)
    -# use example package contained in the goodpractice package
    -pkg_path <- system.file("bad1", package = "goodpractice")
    -g <- gp(pkg_path)
    -
    #> 
    -#> * checking for file ‘/private/var/folders/f3/gr9my1s97r3654cmvzc6dngm0000gn/T/Rtmp6Kts8C/remotesa3ff1315cc49/badpackage/DESCRIPTION’ ... OK
    -#> * preparing ‘badpackage’:
    -#> * checking DESCRIPTION meta-information ... OK
    -#> * checking vignette meta-information ... OK
    -#> * checking for LF line-endings in source and make files and shell scripts
    -#> * checking for empty or unneeded directories
    -#> * building ‘badpackage_1.0.0.tar.gz’
    -
    -g
    -
    #> ── GP badpackage ───────────────────────────────────────────────────────────────
    -#> 
    -#> It is good practice to
    -#> 
    -#>   ✖ not use "Depends" in DESCRIPTION, as it can cause name clashes, and
    -#>     poor interaction with other packages. Use "Imports" instead.
    -#>   ✖ omit "Date" in DESCRIPTION. It is not required and it gets invalid
    -#>     quite often. A build date will be added to the package when you
    -#>     perform `R CMD build` on it.
    -#>   ✖ add a "URL" field to DESCRIPTION. It helps users find information
    -#>     about your package online. If your package does not have a
    -#>     homepage, add an URL to GitHub, or the CRAN package package page.
    -#>   ✖ add a "BugReports" field to DESCRIPTION, and point it to a bug
    -#>     tracker. Many online code hosting services provide bug trackers for
    -#>     free, https://github.com, https://gitlab.com, etc.
    -#>   ✖ omit trailing semicolons from code lines. They are not needed and
    -#>     most R coding standards forbid them
    -#> 
    -#>     R/semicolons.R:4:30
    -#>     R/semicolons.R:5:29
    -#>     R/semicolons.R:9:38
    -#> 
    -#>   ✖ not import packages as a whole, as this can cause name clashes
    -#>     between the imported packages. Instead, import only the specific
    -#>     functions you need.
    -#>   ✖ fix this R CMD check ERROR: VignetteBuilder package not declared:
    -#>     ‘knitr’ See section ‘The DESCRIPTION file’ in the ‘Writing R
    -#>     Extensions’ manual.
    -#>   ✖ avoid 'T' and 'F', as they are just variables which are set to the
    -#>     logicals 'TRUE' and 'FALSE' by default, but are not reserved words
    -#>     and hence can be overwritten by the user.  Hence, one should always
    -#>     use 'TRUE' and 'FALSE' for the logicals.
    -#> 
    -#>     R/tf.R:NA:NA
    -#>     R/tf.R:NA:NA
    -#>     R/tf.R:NA:NA
    -#>     R/tf.R:NA:NA
    -#>     R/tf.R:NA:NA
    -#>     ... and 4 more lines
    -#> 
    -#> ────────────────────────────────────────────────────────────────────────────────
    -
    -# show all available checks
    -# all_checks()
    -
    -# run only a specific check
    -g_url <- gp(pkg_path, checks = "description_url")
    -g_url
    -
    #> ── GP badpackage ───────────────────────────────────────────────────────────────
    -#> 
    -#> It is good practice to
    -#> 
    -#>   ✖ add a "URL" field to DESCRIPTION. It helps users find information
    -#>     about your package online. If your package does not have a
    -#>     homepage, add an URL to GitHub, or the CRAN package package page.
    -#> ────────────────────────────────────────────────────────────────────────────────
    -
    -# which checks were carried out?
    -checks(g_url)
    -
    #> [1] "description_url"
    -
    -# which checks failed?
    -failed_checks(g)
    -
    #> [1] "no_description_depends"                
    -#> [2] "no_description_date"                   
    -#> [3] "description_url"                       
    -#> [4] "description_bugreports"                
    -#> [5] "lintr_trailing_semicolon_linter"       
    -#> [6] "no_import_package_as_a_whole"          
    -#> [7] "rcmdcheck_package_dependencies_present"
    -#> [8] "truefalse_not_tf"
    -
    -# show the first 5 checks carried out and their results
    -results(g)[1:5,]
    -
    #>                    check result
    -#> 1                   covr     NA
    -#> 2              cyclocomp   TRUE
    -#> 3 no_description_depends  FALSE
    -#> 4    no_description_date  FALSE
    -#> 5        description_url  FALSE
    -
    -
    -

    License -

    -

    MIT © Mango Solutions

    -
    -
    -
    - - -
    - - -
    - -
    -

    -

    Site built with pkgdown 2.0.3.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/jquery.sticky-kit.min.js b/docs/jquery.sticky-kit.min.js deleted file mode 100644 index 1c16271..0000000 --- a/docs/jquery.sticky-kit.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/* Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | */ -/* - Source: https://github.com/leafo/sticky-kit - License: MIT -*/ -(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); -if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("
    "))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, -u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),eb&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), -a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", -y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n - - - - - diff --git a/docs/logo.png b/docs/logo.png deleted file mode 100644 index f2b20c3..0000000 Binary files a/docs/logo.png and /dev/null differ diff --git a/docs/news/index.html b/docs/news/index.html deleted file mode 100644 index 344a4fb..0000000 --- a/docs/news/index.html +++ /dev/null @@ -1,112 +0,0 @@ - -Changelog • goodpractice - - -
    -
    - - - -
    -
    - - -
    - -

    Additions:

    -
    • Limit for cyclomatic complexity check can be adjusted using the goodpractice.cyclocomp.limit option, default 50 (#132, @fabian-s).
    • -
    • The number of lines printed to the console by each check result can be set using the new positions_limit parameter into print() - previously it was always 5 lines (#130, @fabian-s).
    • -
    • GitHub Actions now used for CI/CD checks (#145), as well as to calculate code coverage with {covr} and build the package site with {pkgdown}.
    • -

    Bugfixes:

    -
    • Documentation for custom checks significantly improved (#133, @fabian-s).
    • -
    • Year updated in LICENSE, and LICENSE.md added to clarify that {goodpractice} uses the MIT license (#144).
    • -
    -
    - -

    First CRAN release.

    -
    • added 2 vignettes
    • -
    • added examples
    • -
    • added tests
    • -
    • added pkgdown site
    • -
    • fixed check on library/require calls on windows
    • -
    • wrapped prep steps in try
    • -
    -
    - -

    First public release.

    -
    -
    - - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 80ea5b8..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,384 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -/* Ensure in-page images don't run outside their container */ -.contents img { - max-width: 100%; - height: auto; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - display: none; - margin-left: 5px; - width: 20px; - height: 20px; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - display: inline-block; -} - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre, code, pre code { - background-color: #f8f8f8; - color: #333; -} -pre, pre code { - white-space: pre-wrap; - word-break: break-all; - overflow-wrap: break-word; -} - -pre { - border: 1px solid #eee; -} - -pre .img, pre .r-plt { - margin: 5px 0; -} - -pre .img img, pre .r-plt img { - background-color: #fff; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.error {font-weight: bolder;} -.warning {font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} - -/* Section anchors --------------------------------- - Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 -*/ - -div.csl-bib-body { } -div.csl-entry { - clear: both; -} -.hanging-indent div.csl-entry { - margin-left:2em; - text-indent:-2em; -} -div.csl-left-margin { - min-width:2em; - float:left; -} -div.csl-right-inline { - margin-left:2em; - padding-left:1em; -} -div.csl-indent { - margin-left: 2em; -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 6f0eee4..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,108 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $('.navbar-fixed-top').headroom(); - - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $("div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index 5c07367..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,8 +0,0 @@ -pandoc: 2.14.0.3 -pkgdown: 2.0.3 -pkgdown_sha: ~ -articles: - custom_checks: custom_checks.html - goodpractice: goodpractice.html -last_built: 2022-05-19T10:13Z - diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png deleted file mode 100644 index 17a3580..0000000 Binary files a/docs/reference/Rplot001.png and /dev/null differ diff --git a/docs/reference/all_checks.html b/docs/reference/all_checks.html deleted file mode 100644 index f0c81c5..0000000 --- a/docs/reference/all_checks.html +++ /dev/null @@ -1,100 +0,0 @@ - -List the names of all checks — all_checks • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    List the names of all checks

    -
    - -
    -
    all_checks()
    -
    - -
    -

    Value

    -

    Character vector of checks

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/checks.html b/docs/reference/checks.html deleted file mode 100644 index 42496d8..0000000 --- a/docs/reference/checks.html +++ /dev/null @@ -1,129 +0,0 @@ - -List all checks performed — checks • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    List all checks performed

    -
    - -
    -
    checks(gp)
    -
    - -
    -

    Arguments

    -
    gp
    -

    gp output.

    -
    -
    -

    Value

    -

    Character vector of check names.

    -
    -
    -

    See also

    -

    Other API: -failed_checks(), -results()

    -
    - -
    -

    Examples

    -
    path <- system.file("bad1", package = "goodpractice")
    -# run a subset of all checks available
    -g <- gp(path, checks = all_checks()[3:16])
    -#> Preparing: description
    -#> Preparing: lintr
    -#> Preparing: namespace
    -checks(g)
    -#>  [1] "no_description_depends"          "no_description_date"            
    -#>  [3] "description_url"                 "description_bugreports"         
    -#>  [5] "lintr_assignment_linter"         "lintr_line_length_linter"       
    -#>  [7] "lintr_trailing_semicolon_linter" "lintr_attach_detach_linter"     
    -#>  [9] "lintr_setwd_linter"              "lintr_sapply_linter"            
    -#> [11] "lintr_library_require_linter"    "lintr_seq_linter"               
    -#> [13] "no_import_package_as_a_whole"    "no_export_pattern"              
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/customization.html b/docs/reference/customization.html deleted file mode 100644 index 9fecd77..0000000 --- a/docs/reference/customization.html +++ /dev/null @@ -1,151 +0,0 @@ - -Defining custom preparations and checks — customization • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Defining custom preparations and checks

    -
    - -
    -
    make_prep(name, func)
    -
    -make_check(description, check, gp, ...)
    -
    - -
    -

    Arguments

    -
    name
    -

    Name of the preparation function.

    -
    func
    -

    A function that takes two arguments: -The path to the root directory of the package, and a logical -argument: quiet. If quiet is true, the preparation function -may print out diagnostic messages. The output of this function will be -saved as the " name" entry of state, i.e. of the input for -the check-functions (see example).

    -
    description
    -

    A description of the check.

    -
    check
    -

    A function that takes the state as an argument.

    -
    gp
    -

    A short description of what is good practice.

    -
    ...
    -

    Further arguments. Most important: A preps argument that -contains the names of all the preparation functions required for the check.

    -
    -
    -

    Functions

    - -
    • make_prep: Create a preparation function

    • -
    • make_check: Create a check function

    • -
    - -
    -

    Examples

    -
    # make a preparation function
    -url_prep <- make_prep(
    -  name = "desc", 
    -  func = function(path, quiet) desc::description$new(path)
    -)
    -# and the corresponding check function
    -url_chk <- make_check(
    -  description = "URL field in DESCRIPTION",
    -  tags = character(),
    -  preps = "desc",
    -  gp = "have a URL field in DESCRIPTION",
    -  check = function(state) state$desc$has_fields("URL")
    -)
    -# use together in gp():
    -# (note that you have to list the name of your custom check in
    -# the checks-argument as well....)
    -bad1 <- system.file("bad1", package = "goodpractice")
    -res <- gp(bad1, checks = c("url", "no_description_depends"),
    -          extra_preps = list("desc" = url_prep),
    -          extra_checks = list("url" = url_chk))
    -#> Preparing: desc
    -#> Preparing: description
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/default_r_file_pattern.html b/docs/reference/default_r_file_pattern.html deleted file mode 100644 index efb4880..0000000 --- a/docs/reference/default_r_file_pattern.html +++ /dev/null @@ -1,100 +0,0 @@ - -Default pattern for R files — default_r_file_pattern • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Default pattern for R files

    -
    - -
    -
    default_r_file_pattern()
    -
    - -
    -

    Value

    -

    Regular expression.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/export_json.html b/docs/reference/export_json.html deleted file mode 100644 index 0b90b52..0000000 --- a/docs/reference/export_json.html +++ /dev/null @@ -1,105 +0,0 @@ - -Export failed checks to JSON — export_json • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Export failed checks to JSON

    -
    - -
    -
    export_json(gp, file, pretty = FALSE)
    -
    - -
    -

    Arguments

    -
    gp
    -

    gp output.

    -
    file
    -

    Output connection or file.

    -
    pretty
    -

    Whether to pretty-print the JSON.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/failed_checks.html b/docs/reference/failed_checks.html deleted file mode 100644 index 5e9bf91..0000000 --- a/docs/reference/failed_checks.html +++ /dev/null @@ -1,125 +0,0 @@ - -Names of the failed checks — failed_checks • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Names of the failed checks

    -
    - -
    -
    failed_checks(gp)
    -
    - -
    -

    Arguments

    -
    gp
    -

    gp output.

    -
    -
    -

    Value

    -

    Names of the failed checks.

    -
    -
    -

    See also

    -

    Other API: -checks(), -results()

    -
    - -
    -

    Examples

    -
    path <- system.file("bad1", package = "goodpractice")
    -# run a subset of all checks available
    -g <- gp(path, checks = all_checks()[3:16])
    -#> Preparing: description
    -#> Preparing: lintr
    -#> Preparing: namespace
    -failed_checks(g)
    -#> [1] "no_description_depends"          "no_description_date"            
    -#> [3] "description_url"                 "description_bugreports"         
    -#> [5] "lintr_trailing_semicolon_linter" "no_import_package_as_a_whole"   
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/failed_positions.html b/docs/reference/failed_positions.html deleted file mode 100644 index 6a5349e..0000000 --- a/docs/reference/failed_positions.html +++ /dev/null @@ -1,116 +0,0 @@ - -Positions of check failures in the source code — failed_positions • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Note that not all checks refer to the source code. -For these the result will be NULL.

    -
    - -
    -
    failed_positions(gp)
    -
    - -
    -

    Arguments

    -
    gp
    -

    gp output.

    -
    -
    -

    Value

    -

    A list of lists of positions. See details below.

    -
    -
    -

    Details

    -

    For the ones that do, the results is a list, one for each failure. -Since the same check can fail multiple times. A single failure -is a list with entries: filename, line_number, -column_number, ranges. ranges is a list of -pairs of start and end positions for each line involved in the -check.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/figures/logo.png b/docs/reference/figures/logo.png deleted file mode 100644 index f2b20c3..0000000 Binary files a/docs/reference/figures/logo.png and /dev/null differ diff --git a/docs/reference/get_marker.html b/docs/reference/get_marker.html deleted file mode 100644 index a81ca5d..0000000 --- a/docs/reference/get_marker.html +++ /dev/null @@ -1,103 +0,0 @@ - -Get a marker from the positions of a check — get_marker • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Get a marker from the positions of a check

    -
    - -
    -
    get_marker(gp, check)
    -
    - -
    -

    Arguments

    -
    gp
    -

    gp() output

    -
    check
    -

    name of the check to extract

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/goodpractice-package.html b/docs/reference/goodpractice-package.html deleted file mode 100644 index 20ff96e..0000000 --- a/docs/reference/goodpractice-package.html +++ /dev/null @@ -1,113 +0,0 @@ - -goodpractice: Advice on R Package Building — goodpractice-package • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Give advice about good practices when building R packages. Advice includes -functions and syntax to avoid, package structure, code complexity, code -formatting, etc.

    -
    - - - -
    -

    Author

    -

    Maintainer: Ana Simmons ana.simmons@ascent.io (anasimmons)

    -

    Authors:

    Other contributors:

    • Mango Solutions (MangoTheCat) [copyright holder]

    • -
    • Fabian Scheipl (fabian-s) [contributor]

    • -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/gp.html b/docs/reference/gp.html deleted file mode 100644 index c58dd07..0000000 --- a/docs/reference/gp.html +++ /dev/null @@ -1,164 +0,0 @@ - -Run good practice checks — gp • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    To see the results, just print it to the screen.

    -
    - -
    -
    gp(
    -  path = ".",
    -  checks = all_checks(),
    -  extra_preps = NULL,
    -  extra_checks = NULL,
    -  quiet = TRUE
    -)
    -
    - -
    -

    Arguments

    -
    path
    -

    Path to a package root.

    -
    checks
    -

    Character vector, the checks to run. Defaults to -all checks. Use all_checks to list all checks.

    -
    extra_preps
    -

    Custom preparation functions. See -make_prep on creating preparation functions.

    -
    extra_checks
    -

    Custom checks. See make_check on -creating checks.

    -
    quiet
    -

    Whether to suppress output from the preparation -functions. Note that not all preparation functions produce output, -even if this option is set to FALSE.

    -
    -
    -

    Value

    -

    A goodpractice object that you can query -with a simple API. See results to start.

    -
    - -
    -

    Examples

    -
    path <- system.file("bad1", package = "goodpractice")
    -# run a subset of all checks available
    -g <- gp(path, checks = all_checks()[3:16])
    -#> Preparing: description
    -#> Preparing: lintr
    -#> Preparing: namespace
    -g
    -#> -- GP badpackage ---------------------------------------------------------------
    -#> 
    -#> It is good practice to
    -#> 
    -#>   <U+2716> not use "Depends" in DESCRIPTION, as it can cause name
    -#>     clashes, and poor interaction with other packages. Use "Imports"
    -#>     instead.
    -#>   <U+2716> omit "Date" in DESCRIPTION. It is not required and it gets
    -#>     invalid quite often. A build date will be added to the package when
    -#>     you perform `R CMD build` on it.
    -#>   <U+2716> add a "URL" field to DESCRIPTION. It helps users find
    -#>     information about your package online. If your package does not
    -#>     have a homepage, add an URL to GitHub, or the CRAN package package
    -#>     page.
    -#>   <U+2716> add a "BugReports" field to DESCRIPTION, and point it to a
    -#>     bug tracker. Many online code hosting services provide bug trackers
    -#>     for free, https://github.com, https://gitlab.com, etc.
    -#>   <U+2716> omit trailing semicolons from code lines. They are not
    -#>     needed and most R coding standards forbid them
    -#> 
    -#>     R\semicolons.R:4:30
    -#>     R\semicolons.R:5:29
    -#>     R\semicolons.R:9:38
    -#> 
    -#>   <U+2716> not import packages as a whole, as this can cause name
    -#>     clashes between the imported packages. Instead, import only the
    -#>     specific functions you need.
    -#> -------------------------------------------------------------------------------- 
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 10aa1b9..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,130 +0,0 @@ - -Function reference • goodpractice - - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    all_checks()

    -

    List the names of all checks

    -

    checks()

    -

    List all checks performed

    -

    make_prep() make_check()

    -

    Defining custom preparations and checks

    -

    export_json()

    -

    Export failed checks to JSON

    -

    failed_checks()

    -

    Names of the failed checks

    -

    failed_positions()

    -

    Positions of check failures in the source code

    -

    goodpractice-package

    -

    goodpractice: Advice on R Package Building

    -

    gp()

    -

    Run good practice checks

    -

    print(<goodPractice>)

    -

    Print goodpractice results

    -

    results()

    -

    Return all check results in a data frame

    - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/make_check.html b/docs/reference/make_check.html deleted file mode 100644 index 98f6476..0000000 --- a/docs/reference/make_check.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Create a check function — make_check • goodpractice - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Create a check function

    - -
    - -
    make_check(description, check, gp, ...)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    description

    A description of the check.

    check

    A function that takes the state as an argument.

    gp

    A short description of what is good practice.

    ...

    Further arguments.

    - - -

    Examples

    -
    # make a preparation function -url_prep <- make_prep( - name = "desc", - func = function(path, quiet) desc::description$new(path) -) -# and the corresponding check function -url_chk <- make_check( - description = "URL field in DESCRIPTION", - tags = character(), - preps = "desc", - gp = "have a URL field in DESCRIPTION", - check = function(state) state$desc$has_fields("URL") -) -# use together in gp() -bad1 <- system.file("bad1", package = "goodpractice") -res <- gp(bad1, checks = "no_description_depends", - extra_preps = list("desc" = url_prep), - extra_checks = list("url" = url_chk))
    #> Preparing: description
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown.

    -
    - -
    -
    - - - - - - diff --git a/docs/reference/make_prep.html b/docs/reference/make_prep.html deleted file mode 100644 index 679bc6f..0000000 --- a/docs/reference/make_prep.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - -Create a preparation function — make_prep • goodpractice - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Create a preparation function

    - -
    - -
    make_prep(name, func)
    - -

    Arguments

    - - - - - - - - - - -
    name

    Name of the preparation function.

    func

    A function that takes two arguments: -The path to the root directory of the package, and -a logical argument: quiet. If quiet is true, -the preparation function may print out diagnostic messages.

    - - -

    Examples

    -
    # make a preparation function -url_prep <- make_prep( - name = "desc", - func = function(path, quiet) desc::description$new(path) -) -# and the corresponding check function -url_chk <- make_check( - description = "URL field in DESCRIPTION", - tags = character(), - preps = "desc", - gp = "have a URL field in DESCRIPTION", - check = function(state) state$desc$has_fields("URL") -) -# use together in gp() -bad1 <- system.file("bad1", package = "goodpractice") -res <- gp(bad1, checks = "no_description_depends", - extra_preps = list("desc" = url_prep), - extra_checks = list("url" = url_chk))
    #> Preparing: description
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown.

    -
    - -
    -
    - - - - - - diff --git a/docs/reference/make_rcmd_check.html b/docs/reference/make_rcmd_check.html deleted file mode 100644 index d3b6e81..0000000 --- a/docs/reference/make_rcmd_check.html +++ /dev/null @@ -1,119 +0,0 @@ - -Wrapper on make_check, specific to R CMD check — make_rcmd_check • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Wrapper on make_check, specific to R CMD check

    -
    - -
    -
    make_rcmd_check(
    -  description,
    -  pattern,
    -  gp = NULL,
    -  type = c("warnings", "notes", "errors"),
    -  tags = NULL,
    -  preps = NULL,
    -  ...
    -)
    -
    - -
    -

    Arguments

    -
    description
    -

    A description of the check.

    -
    pattern
    -

    The text pattern identifying the check.

    -
    type
    -

    Type of notification, one of "warnings", "notes" or "errors".

    -
    tags
    -

    Tags to be passed on to make_check.

    -
    preps
    -

    Preps to be passed on to make_check.

    -
    ...
    -

    Currently not supported.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/package_collate.html b/docs/reference/package_collate.html deleted file mode 100644 index 011aaf3..0000000 --- a/docs/reference/package_collate.html +++ /dev/null @@ -1,105 +0,0 @@ - -Collate field from DESCRIPTION — package_collate • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    NULL is returned if there is no such field.

    -
    - -
    -
    package_collate(path = ".")
    -
    - -
    -

    Arguments

    -
    path
    -

    Path to the package root.

    -
    -
    -

    Value

    -

    Character scalar or NULL.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/prep_expressions.html b/docs/reference/prep_expressions.html deleted file mode 100644 index 506e039..0000000 --- a/docs/reference/prep_expressions.html +++ /dev/null @@ -1,113 +0,0 @@ - -Extract all closures from a package — prep_expressions • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    The package must be extracted into the working directory, as usual.

    -
    - -
    -
    prep_expressions(state, version = NULL, quiet)
    -
    - -
    -

    Arguments

    -
    state
    -

    GP state.

    -
    version
    -

    Currently ignored.

    -
    -
    -

    Value

    -

    The modified state, with the closures in a named list.

    -
    -
    -

    Details

    -

    We can use lintr to extract the functions, but need to use -our own code (based on similar code in functionMap) to -get the right collation order.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/print.goodPractice.html b/docs/reference/print.goodPractice.html deleted file mode 100644 index 8217782..0000000 --- a/docs/reference/print.goodPractice.html +++ /dev/null @@ -1,106 +0,0 @@ - -Print goodpractice results — print.goodPractice • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Print goodpractice results

    -
    - -
    -
    # S3 method for goodPractice
    -print(x, positions_limit = 5, ...)
    -
    - -
    -

    Arguments

    -
    x
    -

    Object of class goodPractice, as returned by gp().

    -
    positions_limit
    -

    How many positions to print at most.

    -
    ...
    -

    Unused, for compatibility with base::print() generic method.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/r_package_files.html b/docs/reference/r_package_files.html deleted file mode 100644 index 29fcbe9..0000000 --- a/docs/reference/r_package_files.html +++ /dev/null @@ -1,108 +0,0 @@ - -Get all source files of a package, in the right order — r_package_files • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    It uses the Collate entry in the DESCRIPTION file, -if there is one. Otherwise the order is alphabetical.

    -
    - -
    -
    r_package_files(path)
    -
    - -
    -

    Arguments

    -
    path
    -

    Path to the root of the R package.

    -
    -
    -

    Value

    -

    A character vector of (relative) file -names in the current collation order.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/results.html b/docs/reference/results.html deleted file mode 100644 index d6b22a1..0000000 --- a/docs/reference/results.html +++ /dev/null @@ -1,141 +0,0 @@ - -Return all check results in a data frame — results • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Return all check results in a data frame

    -
    - -
    -
    results(gp)
    -
    - -
    -

    Arguments

    -
    gp
    -

    gp output.

    -
    -
    -

    Value

    -

    Data frame, with columns:

    -
    check
    -

    The name of the check.

    -
    result
    -

    Logical, whether it has failed or not.

    -
    -
    -

    See also

    -

    Other API: -checks(), -failed_checks()

    -
    - -
    -

    Examples

    -
    path <- system.file("bad1", package = "goodpractice")
    -# run a subset of all checks available
    -g <- gp(path, checks = all_checks()[3:16])
    -#> Preparing: description
    -#> Preparing: lintr
    -#> Preparing: namespace
    -results(g)
    -#>                              check result
    -#> 1           no_description_depends  FALSE
    -#> 2              no_description_date  FALSE
    -#> 3                  description_url  FALSE
    -#> 4           description_bugreports  FALSE
    -#> 5          lintr_assignment_linter   TRUE
    -#> 6         lintr_line_length_linter   TRUE
    -#> 7  lintr_trailing_semicolon_linter  FALSE
    -#> 8       lintr_attach_detach_linter   TRUE
    -#> 9               lintr_setwd_linter   TRUE
    -#> 10             lintr_sapply_linter   TRUE
    -#> 11    lintr_library_require_linter   TRUE
    -#> 12                lintr_seq_linter   TRUE
    -#> 13    no_import_package_as_a_whole  FALSE
    -#> 14               no_export_pattern   TRUE
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/seq_linter.html b/docs/reference/seq_linter.html deleted file mode 100644 index b9f740a..0000000 --- a/docs/reference/seq_linter.html +++ /dev/null @@ -1,109 +0,0 @@ - -Find dangerous 1:x expressions — seq_linter • goodpractice - - -
    -
    - - - -
    -
    - - -
    -

    Find occurrences of 1:length(x), 1:nrow(x), -1:ncol(x), 1:NROW(x), 1:NCOL(x) where -x is an R expression.

    -
    - -
    -
    seq_linter(source_file)
    -
    - -
    -

    Arguments

    -
    source_file
    -

    Parse data. Passed from lintr.

    -
    -
    -

    Value

    -

    Lint object.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.3.

    -
    - -
    - - - - - - - - diff --git a/docs/sitemap.xml b/docs/sitemap.xml deleted file mode 100644 index c932185..0000000 --- a/docs/sitemap.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - /404.html - - - /articles/custom_checks.html - - - /articles/goodpractice.html - - - /articles/index.html - - - /authors.html - - - /index.html - - - /LICENSE-text.html - - - /LICENSE.html - - - /news/index.html - - - /reference/all_checks.html - - - /reference/checks.html - - - /reference/customization.html - - - /reference/default_r_file_pattern.html - - - /reference/export_json.html - - - /reference/failed_checks.html - - - /reference/failed_positions.html - - - /reference/get_marker.html - - - /reference/goodpractice-package.html - - - /reference/gp.html - - - /reference/index.html - - - /reference/make_check.html - - - /reference/make_prep.html - - - /reference/make_rcmd_check.html - - - /reference/package_collate.html - - - /reference/prep_expressions.html - - - /reference/print.goodPractice.html - - - /reference/results.html - - - /reference/r_package_files.html - - - /reference/seq_linter.html - - diff --git a/pkgdown/favicon/apple-touch-icon-120x120.png b/pkgdown/favicon/apple-touch-icon-120x120.png deleted file mode 100644 index dc28b72..0000000 Binary files a/pkgdown/favicon/apple-touch-icon-120x120.png and /dev/null differ diff --git a/pkgdown/favicon/apple-touch-icon-152x152.png b/pkgdown/favicon/apple-touch-icon-152x152.png deleted file mode 100644 index f5a1924..0000000 Binary files a/pkgdown/favicon/apple-touch-icon-152x152.png and /dev/null differ diff --git a/pkgdown/favicon/apple-touch-icon-180x180.png b/pkgdown/favicon/apple-touch-icon-180x180.png deleted file mode 100644 index 53c2b53..0000000 Binary files a/pkgdown/favicon/apple-touch-icon-180x180.png and /dev/null differ diff --git a/pkgdown/favicon/apple-touch-icon-60x60.png b/pkgdown/favicon/apple-touch-icon-60x60.png deleted file mode 100644 index dc86734..0000000 Binary files a/pkgdown/favicon/apple-touch-icon-60x60.png and /dev/null differ diff --git a/pkgdown/favicon/apple-touch-icon-76x76.png b/pkgdown/favicon/apple-touch-icon-76x76.png deleted file mode 100644 index cbf8e50..0000000 Binary files a/pkgdown/favicon/apple-touch-icon-76x76.png and /dev/null differ diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png deleted file mode 100644 index c7f7774..0000000 Binary files a/pkgdown/favicon/apple-touch-icon.png and /dev/null differ diff --git a/pkgdown/favicon/favicon-16x16.png b/pkgdown/favicon/favicon-16x16.png deleted file mode 100644 index c155b97..0000000 Binary files a/pkgdown/favicon/favicon-16x16.png and /dev/null differ diff --git a/pkgdown/favicon/favicon-32x32.png b/pkgdown/favicon/favicon-32x32.png deleted file mode 100644 index 2366ed9..0000000 Binary files a/pkgdown/favicon/favicon-32x32.png and /dev/null differ diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico deleted file mode 100644 index e2fd2fe..0000000 Binary files a/pkgdown/favicon/favicon.ico and /dev/null differ