Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes #3280 (Styler Section)
This PR introduces a new script,
format.sh
, designed to automate the formatting of all.R
files within the PEcAN repository using thestyler
package. The script performs the following functions:Tracking Formatted Files:
Maintains a
formatted.csv
file that logs each formatted R script's relative path, its MD5 hash, and the timestamp of the last formatting. This ensures that only new or modified files are formatted in subsequent runs.Formatting Process:
.R
files and records their hashes and timestamps.Roxygen Documentation:
After formatting, the script runs
make document
to update all roxygen-based documentation, ensuring that documentation remains consistent with the latest code changes.Motivation and Context
I myself was frustrated a bit on discovering extended formatting issues while working on
workflow.R
.Maintaining consistent code formatting across a large repository like
PEcAN
enhances readability, reduces merge conflicts, and enforces coding standards. Manually formatting and tracking changes in numerous.R
files can be time-consuming and error-prone.This automation facilitates a more streamlined development workflow, allowing contributors to focus on functionality rather than manual formatting tasks.
Review Time Estimate
Types of changes
Checklist: