-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
15 add function to set up precommit #92
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice, got a few revisions, mainly just to tweak the functionality a little.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #92 +/- ##
==========================================
- Coverage 74.21% 66.45% -7.76%
==========================================
Files 12 13 +1
Lines 1109 1249 +140
==========================================
+ Hits 823 830 +7
- Misses 286 419 +133 Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few extra things on this one.
…com/dfe-analytical-services/dfeshiny into 15-add-function-to-set-up-precommit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more ideas around the data file validation side.
…com/dfe-analytical-services/dfeshiny into 15-add-function-to-set-up-precommit
Brief overview of changes
This PR introduces pre-commit hook functionality to the
dfeshiny
package. It includes:R/pre_commit.R
containing all pre-commit functions.testthat/test_precommit.R
.Why are these changes being made?
Detailed description of changes
1. Added
pre_commit.R
inR/
directorypre_commit_innit(skip_analytics = FALSE)
commit_hooks()
..git/hooks/pre-commit
and makes it executable.commit_hooks(skip_analytics = FALSE)
data_checker()
: Validates.gitignore
and tracked files.check_analytics_key()
: Ensures no sensitive Google Analytics keys exist (can be skipped).style_code()
: Formats R code in the repository.2. Added unit tests in
testthat/test_precommit.R
pre_commit_innit()
:commit_hooks()
:Fixes #15.