File size: 2,859 Bytes
e30962b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.4.0
    hooks:
      - id: requirements-txt-fixer
        files: requirements.txt|requirements-dev.txt|requirements-test.txt
      - id: trailing-whitespace
        exclude: |
          (?x)^(
            notebooks/
          )
        args: [--markdown-linebreak-ext=md]
      - id: end-of-file-fixer
        exclude: |
          (?x)^(
            notebooks/
          )
      - id: check-yaml
      - id: check-symlinks
      - id: check-toml
      - id: check-added-large-files
        args: ["--maxkb=1000"]
  - repo: https://github.com/asottile/add-trailing-comma
    rev: v3.1.0
    hooks:
      - id: add-trailing-comma
  - repo: https://github.com/psf/black
    rev: 23.1.0
    hooks:
      - id: black
        exclude: |
          (?x)^(
            notebooks/
          )
  - repo: https://github.com/pycqa/isort
    rev: "5.12.0"
    hooks:
      - id: isort
        exclude: |
          (?x)^(
            notebooks/
          )
  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.9.7
    hooks:
      - id: ruff # linter
        exclude: |
          (?x)^(
            scripts/|
            notebooks/
          )
      # - id: ruff-format
  - repo: local
    hooks:
      - id: update-req
        name: Update requirements.txt
        stages: [pre-commit]
        language: system
        entry: uv
        files: uv.lock|requirements.txt
        pass_filenames: false
        args:
          [
            "export",
            "--format",
            "requirements-txt",
            "--no-hashes",
            "--no-dev",
            "-o",
            "requirements.txt",
          ]
      - id: update-dev-req
        name: Update requirements-dev.txt
        stages: [pre-commit]
        language: system
        entry: uv
        files: uv.lock|requirements-dev.txt
        pass_filenames: false
        args:
          [
            "export",
            "--format",
            "requirements-txt",
            "--no-hashes",
            "--group",
            "dev",
            "--group",
            "test",
            "-o",
            "requirements-dev.txt",
          ]
      - id: mypy
        name: Running mypy
        stages: [commit]
        language: system
        entry: uv run mypy
        args: [--install-types, --non-interactive]
        types: [python]
        exclude: |
          (?x)^(
            scripts/|
            notebooks/
          )

      # - id: pytest
      #   name: pytest
      #   stages: [commit]
      #   language: system
      #   entry: poetry run pytest
      #   types: [python]

      # - id: pytest-cov
      #   name: pytest
      #   stages: [push]
      #   language: system
      #   entry: poetry run pytest --cov --cov-fail-under=100
      #   types: [python]
      #   pass_filenames: false