|
| 1 | +# All available hooks: https://pre-commit.com/hooks.html |
| 2 | +# R specific hooks: https://github.com/lorenzwalthert/precommit |
| 3 | +repos: |
| 4 | +- repo: https://github.com/lorenzwalthert/precommit |
| 5 | + rev: v0.4.3.9021 |
| 6 | + hooks: |
| 7 | + - id: style-files |
| 8 | + args: [--style_pkg=styler, --style_fun=tidyverse_style] |
| 9 | + # - id: roxygenize |
| 10 | + # # roxygen requires loading pkg -> add dependencies from DESCRIPTION |
| 11 | + # additional_dependencies: |
| 12 | + # - Matrix |
| 13 | + # - Rcpp |
| 14 | + - id: use-tidy-description |
| 15 | + - id: spell-check |
| 16 | + exclude: > |
| 17 | + (?x)^( |
| 18 | + .*\.[rR]| |
| 19 | + .*\.feather| |
| 20 | + .*\.jpeg| |
| 21 | + .*\.pdf| |
| 22 | + .*\.png| |
| 23 | + .*\.py| |
| 24 | + .*\.RData| |
| 25 | + .*\.rds| |
| 26 | + .*\.Rds| |
| 27 | + .*\.Rproj| |
| 28 | + .*\.sh| |
| 29 | + (.*/|)\.gitignore| |
| 30 | + (.*/|)\.gitlab-ci\.yml| |
| 31 | + (.*/|)\.lintr| |
| 32 | + (.*/|)\.pre-commit-.*| |
| 33 | + (.*/|)\.Rbuildignore| |
| 34 | + (.*/|)\.Renviron| |
| 35 | + (.*/|)\.Rprofile| |
| 36 | + (.*/|)\.travis\.yml| |
| 37 | + (.*/|)appveyor\.yml| |
| 38 | + (.*/|)NAMESPACE| |
| 39 | + (.*/|)renv/settings\.dcf| |
| 40 | + (.*/|)renv\.lock| |
| 41 | + (.*/|)WORDLIST| |
| 42 | + \.github/workflows/.*| |
| 43 | + data/.*| |
| 44 | + )$ |
| 45 | + - id: lintr |
| 46 | + args: [--warn_only] |
| 47 | + verbose: false |
| 48 | + - id: readme-rmd-rendered |
| 49 | + - id: parsable-R |
| 50 | + - id: no-browser-statement |
| 51 | + - id: no-print-statement |
| 52 | + - id: no-debug-statement |
| 53 | + - id: deps-in-desc |
| 54 | + - id: pkgdown |
| 55 | +- repo: https://github.com/pre-commit/mirrors-clang-format |
| 56 | + rev: v22.1.2 |
| 57 | + hooks: |
| 58 | + - id: clang-format |
| 59 | + args: ["--style=Google"] |
| 60 | + exclude: ./src/RcppExports.cpp |
| 61 | +- repo: https://github.com/cpplint/cpplint |
| 62 | + rev: 2.0.2 |
| 63 | + hooks: |
| 64 | + - id: cpplint |
| 65 | + args: |
| 66 | + - --exclude=src/RcppExports.cpp |
| 67 | +- repo: https://github.com/pre-commit/pre-commit-hooks |
| 68 | + rev: v6.0.0 |
| 69 | + hooks: |
| 70 | + - id: check-added-large-files |
| 71 | + args: ['--maxkb=200'] |
| 72 | + - id: file-contents-sorter |
| 73 | + files: '^\.Rbuildignore$' |
| 74 | + # - id: end-of-file-fixer |
| 75 | + # exclude: '\.Rd,R/RcppExports.R' |
| 76 | +- repo: https://github.com/pre-commit-ci/pre-commit-ci-config |
| 77 | + rev: v1.6.1 |
| 78 | + hooks: |
| 79 | + # Only required when https://pre-commit.ci is used for config validation |
| 80 | + - id: check-pre-commit-ci-config |
| 81 | +- repo: local |
| 82 | + hooks: |
| 83 | + - id: forbid-to-commit |
| 84 | + name: Don't commit common R artifacts |
| 85 | + entry: Cannot commit .Rhistory, .RData |
| 86 | + language: fail |
| 87 | + files: '\.(Rhistory|RData|)$' |
| 88 | + # `exclude: <regex>` to allow committing specific files |
| 89 | + |
| 90 | +ci: |
| 91 | + autoupdate_schedule: monthly |
0 commit comments