repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
args: ["--maxkb=200"]
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: local
hooks:
- id: restricted-file-extensions
name: check against file extension whitelist
entry: These file extensions are unusual and should be checked
language: fail
files: '^.*\.(?!md$|sh$|yaml$|json$|git.*$|png$|svg$|jpg$|rs$|lock$|toml$|py$|R$|Rproj$|Rprofile$)[^.]+$'
- id: restricted-file-types
name: check for unexpected file types
entry: These file types are unusual and should be checked
language: fail
types: ["binary"]
exclude_types: ["image"]
- id: fmt
name: fmt
description: Format files with cargo fmt.
language: system
types: [file, rust]
entry: cargo fmt -- --check
pass_filenames: false
- id: cargo-check
name: cargo check
description: Check the package for errors.
language: system
types: [file, rust]
entry: cargo check
pass_filenames: false
- id: clippy
name: cargo clippy
description: Run the Clippy linter on the package.
language: system
types: [file, rust]
entry: cargo clippy --all-targets --all-features -- -D warnings
pass_filenames: false
exclude: ".vscode/.*|target/.*"