๐Ÿ“ฆ j178 / prek

๐Ÿ“„ .pre-commit-config.yaml ยท 56 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56fail_fast: true
default_install_hook_types: [pre-push]
exclude: |
  (?x)^(
    .*/(snapshots)/.*|
  )$

repos:
  - repo: builtin
    hooks:
      - id: trailing-whitespace
      - id: mixed-line-ending
      - id: check-yaml
      - id: check-toml
      - id: end-of-file-fixer

  - repo: https://github.com/crate-ci/typos
    rev: v1.42.0
    hooks:
      - id: typos

  - repo: https://github.com/executablebooks/mdformat
    rev: '1.0.0'
    hooks:
      - id: mdformat
        language: python  # ensures that Renovate can update additional_dependencies
        args: [--number, --compact-tables, --align-semantic-breaks-in-lists]
        additional_dependencies:
          - mdformat-mkdocs==5.1.3
          - mdformat-simple-breaks==0.1.0

  - repo: local
    hooks:
      - id: taplo-fmt
        name: taplo fmt
        entry: taplo fmt --config .config/taplo.toml
        language: python
        additional_dependencies: ["taplo==0.9.3"]
        types: [toml]

  - repo: local
    hooks:
      - id: cargo-fmt
        name: cargo fmt
        entry: cargo fmt --
        language: system
        types: [rust]
        pass_filenames: false # This makes it a lot faster

      - id: cargo-clippy
        name: cargo clippy
        language: system
        types: [rust]
        pass_filenames: false
        entry: cargo clippy --all-targets --all-features -- -D warnings