Skip to content

Commit

Permalink
Merge pull request #76 from imperialCHEPI/tests
Browse files Browse the repository at this point in the history
Unit testing for data-process.R
  • Loading branch information
SaranjeetKaur authored Oct 29, 2024
2 parents 13af2cb + 94dc0b8 commit 5f9f91b
Show file tree
Hide file tree
Showing 16 changed files with 967 additions and 487 deletions.
9 changes: 5 additions & 4 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
^renv$
^renv\.lock$
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^\.github$
^README\.Rmd$
^\.Rproj\.user$
^\.github$
^\.pre-commit-config\.yaml$
^_pkgdown\.yml$
^docs$
^pkgdown$
^renv$
^renv\.lock$
76 changes: 76 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# All available hooks: https://pre-commit.com/hooks.html
# R specific hooks: https://github.com/lorenzwalthert/precommit
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.3.9001
hooks:
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style]
- id: roxygenize
# codemeta must be above use-tidy-description when both are used
# - id: codemeta-description-updated
- id: use-tidy-description
- id: spell-check
exclude: >
(?x)^(
.*\.[rR]|
.*\.feather|
.*\.jpeg|
.*\.pdf|
.*\.png|
.*\.py|
.*\.RData|
.*\.rds|
.*\.Rds|
.*\.Rproj|
.*\.sh|
(.*/|)\.gitignore|
(.*/|)\.gitlab-ci\.yml|
(.*/|)\.lintr|
(.*/|)\.pre-commit-.*|
(.*/|)\.Rbuildignore|
(.*/|)\.Renviron|
(.*/|)\.Rprofile|
(.*/|)\.travis\.yml|
(.*/|)appveyor\.yml|
(.*/|)NAMESPACE|
(.*/|)renv/settings\.dcf|
(.*/|)renv\.lock|
(.*/|)WORDLIST|
\.github/workflows/.*|
data/.*|
)$
- id: lintr
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-print-statement
- id: no-debug-statement
- id: deps-in-desc
- id: pkgdown
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=200']
- id: file-contents-sorter
files: '^\.Rbuildignore$'
- id: end-of-file-fixer
exclude: '\.Rd'
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
# Only required when https://pre-commit.ci is used for config validation
- id: check-pre-commit-ci-config
- repo: local
hooks:
- id: forbid-to-commit
name: Don't commit common R artifacts
entry: Cannot commit .Rhistory, .RData, .Rds or .rds.
language: fail
files: '\.(Rhistory|RData|Rds|rds)$'
# `exclude: <regex>` to allow committing specific files

ci:
autoupdate_schedule: monthly
skip: [pkgdown]
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ Imports:
ggplot2,
grDevices,
gridExtra,
purrr,
rlang,
scales,
splines,
stats,
stringr,
tidyr
Suggests:
testthat (>= 3.0.0)
Expand Down
Loading

0 comments on commit 5f9f91b

Please sign in to comment.