goodpractice 1.0.5.9000 (dev version)
- Added
makefile(#203) - Lowered default cyclomatic complexity limit from 50 to 15, aligning with lintr and pkgcheck defaults. Configurable via
goodpractice.cyclocomp_limitoption (#150). - Expanded default lintr checks from 9 to ~53, covering correctness (e.g.
anyDuplicated()vsany(duplicated())), performance (e.g.colSums()vsapply()), readability (e.g.switch()vs long if/else chains), and testthat best practices (e.g.expect_identical()vsexpect_equal()). All respect.lintrconfiguration files (#189). - Exclude specific files from checks via
goodpractice.exclude_pathoption orGP_EXCLUDE_PATHenvironment variable. Useful for generated code likeR/RcppExports.R. - Preparation steps can now run in parallel via the
future.applypackage. Setfuture::plan("multisession")before callinggp()to enable parallel data gathering (#47). - New
all_check_groups()andchecks_by_group()functions for discovering and selecting checks by category instead of individual names (#239). - Every check now belongs to a named group. Use
all_check_groups()to see the 16 available groups andchecks_by_group("description")to list checks in a group. - Exclude entire check groups via
goodpractice.exclude_check_groupsoption orGP_EXCLUDE_CHECK_GROUPSenvironment variable. - New roxygen2 checks: export/noRd tagging, unknown tags, and
@inheritParams/@inheritDotParamsvalidation (#197). - New
duplicate_function_bodiescheck: flags functions with identical bodies across files that should be consolidated into a shared helper (#232). - Check advice now uses cli inline markup throughout. All
gpstrings support{.code},{.fn},{.pkg},{.file},{.field}, and{.url}for consistent styling. Custom checks can use the same markup in theirgpstrings. - New optional tidyverse style guide checks: 21 lintr-based checks plus 2 structural checks (R file naming, test file mirroring). Opt in via
checks = c(default_checks(), tidyverse_checks()). - New
default_checks()andtidyverse_checks()helper functions.gp()now defaults todefault_checks()instead ofall_checks(), keeping optional check sets out of the default run. - New
has_readmeandhas_newschecks for package documentation completeness (#45). -
gp()now fails if the path provided to it is not a package (does not contain a DESCRIPTION file) (#190, @maelle) - goodpractice now uses cli, and no longer depends on crayon and clisymbols (@olivroy, #167).
- If your editor supports it, goodpractice now prints clickable hyperlinks to console.
- New
describe_check()function to print descriptions of all implemented checks (@152) - New
r_file_extensioncheck: flags R scripts using.ror.qinstead of.R(#121). - New
print_return_invisiblecheck: flags print methods that don’t returninvisible(x)(#49). - New
vignette_no_rm_listcheck: flagsrm(list = ls())in vignettes (#20). - New
vignette_no_setwdcheck: flagssetwd()in vignettes (#21). - R code inspection now uses treesitter for AST-based parsing instead of regex or
getParseData(). Checks likeprint_return_invisible,tidyverse_no_missing, andtidyverse_export_orderbenefit from more robust and faster code analysis. - New
reverse_dependenciescheck: queries CRAN for reverse dependencies and advises runningrevdepcheck::revdep_check()before submission. -
gp_advice()gains atypeparameter ("error","info","warning") to control the output symbol and colour. Checks can returnlist(status = TRUE, type = "info")to display informational messages without a failure cross. - Prep step error handling refactored into
run_prep_step()helper. New prep functions can userun_prep_step(state, "name", function() { ... }, quiet)instead of manually wrapping work intry()and emitting warnings on failure. - New
spellingcheck: flags misspelled words in documentation viaspelling::spell_check_package()(#84). - New DESCRIPTION checks (#122, #85):
-
description_not_start_with_package: Description should not start with “This package” -
description_urls_in_angle_brackets: URLs in Description must be wrapped in angle brackets -
description_doi_format: DOIs should use<doi:...>not full URLs -
description_urls_not_http: URLs should use https not http -
no_description_duplicate_deps: No duplicate packages across dependency fields -
description_valid_roles: Authors@R roles must be valid MARC relator codes -
description_pkgname_single_quoted: Package names in Title/Description must be single-quoted
-
- Removed
stringsAsFactors = FALSEarguments throughout, relying on the R 4.0 default. Package now requires R >= 4.0.0.
goodpractice 1.0.5
CRAN release: 2024-06-04
- New maintainer: rOpenSci
- Package reinstated on CRAN, after archiving of previous version.
- CRAN fixes - skipping failing test and adding to package Rd
- Adding docs.ropensci site to DESCRIPTION
goodpractice 1.0.3
CRAN release: 2022-07-13
Additions:
- Limit for cyclomatic complexity check can be adjusted using the
goodpractice.cyclocomp.limitoption, default 50 (#132, @fabian-s). - The number of lines printed to the console by each check result can be set using the new
positions_limitparameter intoprint()- 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:
