The goodpractice package, established over a decade ago by Gábor Csárdi, has undergone significant enhancements. Once relying on manual checks for software peer reviews, it now integrates with the pkgcheck system for automated assessments of new submissions. This evolution marks a shift in how package authors can address quality concerns efficiently.
With its recent updates, the goodpractice package has transformed to be more intuitive and capable, thanks largely to contributions from Athanasia Mo Mowinckel and maintainer Mark Padgham, alongside the AI tool Claude. This collaboration has resulted in a suite of improvements that address user experience and functionality.
Streamlined Check Management
Previously, managing which checks to run within the goodpractice package could be cumbersome. The old system had 230 checks identified by the corresponding package names, requiring cumbersome character vector inputs to bypass certain checks. For example, excluding rcmdcheck checks necessitated complicated coding that discouraged user engagement.
In response to user feedback, the package has introduced a grouping system that organizes checks by their corresponding source packages, simplifying user interactions. Users can now easily specify check groups via the all_check_groups() and checks_by_group() functions. In practice, running a selected group of checks is as straightforward as naming the intended groups:
gp(checks = checks_by_group("description", "lintr"))
Introduction of New Check Groups
The update also includes new check groups designed to enhance code quality further. These additions bring the total checks to 338, significantly increasing the package’s capability. The all_check_groups() function provides insights into these new groups, which include:
| Group Name | Run by Default? | Description |
|---|---|---|
| description | yes | Checks formatting issues in DESCRIPTION files, including URLs, DOIs, and contributor roles. |
| rd | yes | Ensures that function documentation in man/*.Rd includes examples and return values. |
| roxygen2 | yes | Identifies problems in documentation generated by Roxygen2. |
| revdep | no | Performs reverse-dependency checks. |
| code_structure | yes | Detects common issues such as duplicated functions. |
| package_structure | yes | Checks for standard files like README and NEWS. |
| spelling | yes | Validates spelling throughout the package. |
| tidyverse | no | Checks compliance with the Tidyverse style guide, primarily through lintr. |
| urlchecker | yes | Confirms the validity of all URLs. |
| vignette | yes | Ensures vignettes don’t use rm() or setwd(). |
The integration of treesitter for parsing enhances the efficiency of these checks, providing a more powerful framework for R developers.
Enhanced Reporting Features
The latest version of goodpractice not only adds new checks but also improves the way results are reported. Console output has been refined to give detailed insights into the checking process. Using the cli package, the output formatting is now consistent across all check groups, improving usability significantly.
Given the expanded number of checks, users might find the output overwhelming. The new groups parameter in the print() method allows users to focus on specific check results one group at a time, making it easier to digest information and address issues incrementally:
x <- gp() print(x, "description") print(x, "namespace")
Collaborative Development Insights
This update marks a notable collaboration between human and AI. Athanasia Mo Mowinckel openly acknowledges the significant role of AI in streamlining the coding process—specifically, the use of Claude for drafting and refining checks. Mark Padgham served as a reviewer, guiding the coding efforts while learning how to integrate AI into conventional development practices more effectively.
Mo discusses these insights candidly, noting that collaborative coding with AI requires thoughtful management of tasks, especially in ensuring that code quality remains high while leveraging the speed that AI can provide. Through this partnership, the team transformed their approach to development, ultimately creating a more effective tool for the community.
Community Engagement
As with all rOpenSci projects, feedback is key for the success of the goodpractice package. The development team encourages users to reach out with thoughts and suggestions via email or through the GitHub repository. This ongoing dialogue will continue to shape the tool’s evolution as it adapts to the needs of its users.