CSAFE-ISU / handwriter

Forensic Handwriting Analysis Pipeline in R - Please download our stable version from CRAN using 'install.packages("handwriter")'
GNU Affero General Public License v3.0
24 stars 9 forks source link

Incorporate the styler package with pre-commit #24

Open stephaniereinders opened 1 year ago

stephaniereinders commented 1 year ago

https://github.com/lorenzwalthert/precommit

ahgamut commented 1 year ago

The pre-commit R package mentioned in the above link uses Python in the background to do a bunch of things automatically whenever you do a git commit:

pre-commit requires a simple yml configuration file, and it requires python to be installed on your computer.

I tried it out here: https://github.com/ahgamut/handwriter/commits/rearrange

The advantage of pre-commit is that it automatically enforces a consistent style and structure on the code in an R package.

One of the disadvantages is that if you introduce pre-commit after a while, it can add a lot of changes at once, which messes with git blame and the update history of the code.

Perhaps a pre-commit can be attempted after other updates to handwriter.