rhino icon indicating copy to clipboard operation
rhino copied to clipboard

Configure pre-commit

Open TymekDev opened this issue 1 year ago • 1 comments

I was working on another thing and didn't want to figure out what checks to run, so... I configured pre-commit 😁

Description

This PR adds pre-commit config. pre-commit introduces a series of checks (and fixes) that can be run as git hooks. It is loosely based on a config that I used in shiny.telemetry. I have improved the config to not require globally installed packages.

Note: I have specifically omitted running tests as they can get slow with time and running pre-commit on a pre-commit hook would get annoying.

How to Test

  1. Follow setup instructions in CONTRIBUTING.md
  2. Run pre-commit run --all-files to see if the checks pass

Proposed Next Steps

  1. Configure pre-commit.ci
  2. Remove duplication of checks between pre-commit.ci and GitHub Actions

Definition of Done

  • [x] The change is thoroughly documented.
  • [x] The CI passes (R CMD check, linter, unit tests, spelling).
  • [x] Any generated files have been updated (e.g. .Rd files with roxygen2::roxygenise())

TymekDev avatar Jun 17 '24 08:06 TymekDev

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 20.65%. Comparing base (7ae011f) to head (65dc2f5).

:exclamation: Current head 65dc2f5 differs from pull request most recent head 5dc7631

Please upload reports for the commit 5dc7631 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #593   +/-   ##
=======================================
  Coverage   20.65%   20.65%           
=======================================
  Files           9        9           
  Lines         460      460           
=======================================
  Hits           95       95           
  Misses        365      365           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jun 17 '24 08:06 codecov-commenter