diff --git a/.Rbuildignore b/.Rbuildignore index 7712cbd..ffb5d8c 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,9 +1,10 @@ ^.*\.Rproj$ +^LICENSE\.md$ ^\.Rproj\.user$ +^\.github$ +^\.lintr$ +^\.pre-commit-config\.yaml$ ^_pkgdown\.yml$ ^data-raw$ ^docs$ ^pkgdown$ -^\.github$ -^LICENSE\.md$ -^\.lintr$ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..52a8b2b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,65 @@ +# 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.2 + hooks: + - id: style-files + args: [--style_pkg=styler, --style_fun=tidyverse_style] + - id: roxygenize + - 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/.*| + Makefile| + )$ + - id: lintr + - 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: v4.6.0 + hooks: + - id: check-added-large-files + args: ['--maxkb=200'] + - id: file-contents-sorter + files: '^\.Rbuildignore$' + - id: end-of-file-fixer + exclude: '\.Rd' +- 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: ` to allow committing specific files diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2edc8c7 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +document: + R -e 'devtools::document()' + +build: + R -e 'devtools::build()' + +install: + R -e 'pak::local_install(upgrade = FALSE)'