|
| 1 | +default_stages: |
| 2 | + - "commit" |
| 3 | +fail_fast: false |
| 4 | +repos: |
| 5 | + - hooks: |
| 6 | + - id: cleanup-pre-commit |
| 7 | + name: Cleanup dirty files before pre-commit checks |
| 8 | + stages: [commit, push] |
| 9 | + language: system |
| 10 | + entry: ./pre-commit/cleanup |
| 11 | + pass_filenames: false |
| 12 | + always_run: true |
| 13 | + types: [file, directory] |
| 14 | + repo: local |
| 15 | + - hooks: |
| 16 | + - id: check-yaml |
| 17 | + - id: check-toml |
| 18 | + - id: check-json |
| 19 | + types: ["json"] |
| 20 | + - id: end-of-file-fixer |
| 21 | + - id: check-case-conflict |
| 22 | + - id: fix-byte-order-marker |
| 23 | + - id: trailing-whitespace |
| 24 | + - id: check-added-large-files |
| 25 | + exclude: "^.*.mp3|lock$" |
| 26 | + args: |
| 27 | + - --maxkb=600 |
| 28 | + - id: mixed-line-ending |
| 29 | + repo: https://github.com/pre-commit/pre-commit-hooks |
| 30 | + rev: v4.4.0 |
| 31 | + - hooks: |
| 32 | + - id: ruff |
| 33 | + args: ["--fix", "--show-fixes", "--config", "pyproject.toml"] |
| 34 | + pass_filenames: false |
| 35 | + types: |
| 36 | + - "python" |
| 37 | + exclude_types: |
| 38 | + - "jupyter" |
| 39 | + repo: https://github.com/charliermarsh/ruff-pre-commit |
| 40 | + rev: v0.0.289 |
| 41 | + - hooks: |
| 42 | + - id: black |
| 43 | + types: |
| 44 | + - "python" |
| 45 | + exclude_types: |
| 46 | + - "jupyter" |
| 47 | + repo: https://github.com/psf/black |
| 48 | + rev: 23.9.1 |
| 49 | + - hooks: |
| 50 | + - id: mypy |
| 51 | + name: Static Type Checking with Mypy |
| 52 | + language: system |
| 53 | + entry: mypy --install-types --non-interactive --config-file pyproject.toml ./ |
| 54 | + types: |
| 55 | + - "python" |
| 56 | + pass_filenames: false |
| 57 | + repo: local |
| 58 | + - hooks: |
| 59 | + - id: nbqa-black |
| 60 | + additional_dependencies: [black>=23.1.0] |
| 61 | + repo: https://github.com/nbQA-dev/nbQA |
| 62 | + rev: "1.7.0" |
| 63 | + - hooks: |
| 64 | + - args: |
| 65 | + - --ignore |
| 66 | + - DL3008 |
| 67 | + id: hadolint |
| 68 | + repo: https://github.com/AleksaC/hadolint-py |
| 69 | + rev: v2.12.0.2 |
| 70 | + - repo: https://github.com/pre-commit/mirrors-prettier |
| 71 | + rev: v3.0.3 |
| 72 | + hooks: |
| 73 | + - id: prettier |
| 74 | + name: Format yaml, json, toml, markdown, bash, and shell files with prettier |
| 75 | + additional_dependencies: |
| 76 | + - prettier@2.8.3 |
| 77 | + - prettier-plugin-sh@0.12.8 |
| 78 | + - prettier-plugin-toml@0.3.1 |
| 79 | + types_or: |
| 80 | + - yaml |
| 81 | + - json |
| 82 | + - toml |
| 83 | + - markdown |
| 84 | + - bash |
| 85 | + - shell |
| 86 | + pass_filenames: true |
| 87 | + - hooks: |
| 88 | + - id: commitizen |
| 89 | + stages: |
| 90 | + - commit-msg |
| 91 | + repo: https://github.com/commitizen-tools/commitizen |
| 92 | + rev: 3.8.2 |
| 93 | + # - hooks: |
| 94 | + # - id: generate-lock |
| 95 | + # name: Generate `poetry` lock for `root` `pyproject` |
| 96 | + # language: system |
| 97 | + # stages: [manual, pre-commit] |
| 98 | + # pass_filenames: false |
| 99 | + # entry: poetry lock |
| 100 | + # args: ["-C", "."] |
| 101 | + # files: ^(.*/)?pyproject\.toml$ |
| 102 | + # - id: check-sync-root |
| 103 | + # name: Check `root` `pyproject` and `poetry.lock` are in-sync and valid |
| 104 | + # language: system |
| 105 | + # pass_filenames: false |
| 106 | + # entry: poetry check |
| 107 | + # args: ["--lock", "-C", "."] |
| 108 | + # files: ^(.*/)?(poetry\.lock|pyproject\.toml)$ |
| 109 | + # - id: export |
| 110 | + # name: run poetry export on `main` deps for `root` project to sync lock file with requirements.txt |
| 111 | + # language: system |
| 112 | + # pass_filenames: false |
| 113 | + # entry: poetry export |
| 114 | + # args: |
| 115 | + # [ |
| 116 | + # "--only", |
| 117 | + # "main", |
| 118 | + # "-C", |
| 119 | + # ".", |
| 120 | + # "-f", |
| 121 | + # "requirements.txt", |
| 122 | + # "-o", |
| 123 | + # "./requirements.txt", |
| 124 | + # "--without-hashes", |
| 125 | + # ] |
| 126 | + # files: ^(.*/)?poetry\.lock$ |
| 127 | + # repo: local |
| 128 | + - hooks: |
| 129 | + - id: licenseheaders |
| 130 | + name: Update License headers |
| 131 | + stages: ["commit", "push"] |
| 132 | + args: |
| 133 | + - "-t" |
| 134 | +
42E6
- "./pre-commit/LICENSE.tmpl" |
| 135 | + - "-cy" |
| 136 | + - "-o" |
| 137 | + - "krishnakumar <ksquarekumar@gmail.com>" |
| 138 | + - "-n" |
| 139 | + - "jupyter-docker" |
| 140 | + - "-u" |
| 141 | + - "https://github.com/ksquarekumar/jupyter-docker" |
| 142 | + - "-f" |
| 143 | + types_or: |
| 144 | + - "python" |
| 145 | + - "executable" |
| 146 | + exclude: ^whisper_stream/vendored/whisper_jax/ |
| 147 | + pass_filenames: true |
| 148 | + repo: https://github.com/johann-petrak/licenseheaders.git |
| 149 | + rev: "v0.8.8" |
| 150 | + - hooks: |
| 151 | + - id: cleanup-post-commit |
| 152 | + name: Cleanup dirty files after pre-commit |
| 153 | + stages: [post-commit] |
| 154 | + language: system |
| 155 | + entry: ./pre-commit/cleanup |
| 156 | + pass_filenames: false |
| 157 | + always_run: true |
| 158 | + types: [file, directory] |
| 159 | + repo: local |
0 commit comments