Skip to content

Commit

Permalink
Use R specific pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zsusswein committed Aug 6, 2024
1 parent 502d94d commit 3a49473
Showing 1 changed file with 42 additions and 19 deletions.
61 changes: 42 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,66 @@
# All available hooks: https://pre-commit.com/hooks.html
# R specific hooks: https://github.com/lorenzwalthert/precommit
repos:
#####
# Basic file cleanliness
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
# R
- 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: lintr
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-print-statement
- id: no-debug-statement
- id: deps-in-desc
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-yaml
- id: check-toml
args: ['--maxkb=200']
- id: file-contents-sorter
files: '^\.Rbuildignore$'
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
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
#####
# Python
- repo: https://github.com/psf/black
rev: 23.10.0
rev: 24.4.2
hooks:
# if you have ipython notebooks, consider using
# `black-jupyter` hook instead
- id: black
args: ['--line-length', '79']
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ['--profile', 'black',
'--line-length', '79']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.0
rev: v0.4.2
hooks:
- id: ruff
#####
# R
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.2
hooks:
- id: style-files
- id: lintr
#####
# Java
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
rev: v2.13.0
hooks:
- id: pretty-format-java
args: [--aosp,--autofix]
Expand All @@ -59,3 +80,5 @@ repos:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
ci:
autoupdate_schedule: monthly

0 comments on commit 3a49473

Please sign in to comment.