Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 1 | - id: check-added-large-files |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 2 | name: check for added large files |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 3 | description: prevents giant files from being committed. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 4 | entry: check-added-large-files |
| 5 | language: python |
Anthony Sottile | d17fe99 | 2022-06-06 12:24:03 -0400 | [diff] [blame] | 6 | stages: [commit, push, manual] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 7 | - id: check-ast |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 8 | name: check python ast |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 9 | description: simply checks whether the files parse as valid python. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 10 | entry: check-ast |
| 11 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 12 | types: [python] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 13 | - id: check-byte-order-marker |
Jeremiah Gowdy | d18bd5b | 2020-10-04 18:45:54 -0700 | [diff] [blame] | 14 | name: 'check BOM - deprecated: use fix-byte-order-marker' |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 15 | description: forbids files which have a utf-8 byte-order marker. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 16 | entry: check-byte-order-marker |
| 17 | language: python |
Toby Fleming | 841c47e | 2019-03-21 16:33:00 -0700 | [diff] [blame] | 18 | types: [text] |
Ben Webber | 35996b7 | 2017-11-26 00:17:47 +0000 | [diff] [blame] | 19 | - id: check-builtin-literals |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 20 | name: check builtin type constructor use |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 21 | description: requires literal syntax when initializing empty or zero python builtin types. |
Ben Webber | 35996b7 | 2017-11-26 00:17:47 +0000 | [diff] [blame] | 22 | entry: check-builtin-literals |
| 23 | language: python |
| 24 | types: [python] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 25 | - id: check-case-conflict |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 26 | name: check for case conflicts |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 27 | description: checks for files that would conflict in case-insensitive filesystems. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 28 | entry: check-case-conflict |
| 29 | language: python |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 30 | - id: check-docstring-first |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 31 | name: check docstring is first |
| 32 | description: checks a common error of defining a docstring after code. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 33 | entry: check-docstring-first |
| 34 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 35 | types: [python] |
Chris Kuehl | 13991f0 | 2017-07-02 21:00:28 -0700 | [diff] [blame] | 36 | - id: check-executables-have-shebangs |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 37 | name: check that executables have shebangs |
| 38 | description: ensures that (non-binary) executables have a shebang. |
Chris Kuehl | 13991f0 | 2017-07-02 21:00:28 -0700 | [diff] [blame] | 39 | entry: check-executables-have-shebangs |
| 40 | language: python |
| 41 | types: [text, executable] |
Iulian Onofrei | 93e3a4f | 2019-02-02 10:38:39 +0200 | [diff] [blame] | 42 | stages: [commit, push, manual] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 43 | - id: check-json |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 44 | name: check json |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 45 | description: checks json files for parseable syntax. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 46 | entry: check-json |
| 47 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 48 | types: [json] |
Ville Skyttä | 391ae30 | 2021-01-08 17:36:55 +0200 | [diff] [blame] | 49 | - id: check-shebang-scripts-are-executable |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 50 | name: check that scripts with shebangs are executable |
| 51 | description: ensures that (non-binary) files with a shebang are executable. |
Ville Skyttä | 391ae30 | 2021-01-08 17:36:55 +0200 | [diff] [blame] | 52 | entry: check-shebang-scripts-are-executable |
| 53 | language: python |
| 54 | types: [text] |
| 55 | stages: [commit, push, manual] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 56 | - id: pretty-format-json |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 57 | name: pretty format json |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 58 | description: sets a standard for formatting json files. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 59 | entry: pretty-format-json |
| 60 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 61 | types: [json] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 62 | - id: check-merge-conflict |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 63 | name: check for merge conflicts |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 64 | description: checks for files that contain merge conflict strings. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 65 | entry: check-merge-conflict |
| 66 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 67 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 68 | - id: check-symlinks |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 69 | name: check for broken symlinks |
| 70 | description: checks for symlinks which do not point to anything. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 71 | entry: check-symlinks |
| 72 | language: python |
Anthony Sottile | c472043 | 2017-07-02 19:55:58 -0700 | [diff] [blame] | 73 | types: [symlink] |
Semyon Maryasin | ae70f7e | 2019-03-28 01:13:45 +0300 | [diff] [blame] | 74 | - id: check-toml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 75 | name: check toml |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 76 | description: checks toml files for parseable syntax. |
Semyon Maryasin | ae70f7e | 2019-03-28 01:13:45 +0300 | [diff] [blame] | 77 | entry: check-toml |
| 78 | language: python |
| 79 | types: [toml] |
Anthony Sottile | 9db0a74 | 2017-10-06 23:32:11 -0700 | [diff] [blame] | 80 | - id: check-vcs-permalinks |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 81 | name: check vcs permalinks |
| 82 | description: ensures that links to vcs websites are permalinks. |
Anthony Sottile | 9db0a74 | 2017-10-06 23:32:11 -0700 | [diff] [blame] | 83 | entry: check-vcs-permalinks |
| 84 | language: python |
| 85 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 86 | - id: check-xml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 87 | name: check xml |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 88 | description: checks xml files for parseable syntax. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 89 | entry: check-xml |
| 90 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 91 | types: [xml] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 92 | - id: check-yaml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 93 | name: check yaml |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 94 | description: checks yaml files for parseable syntax. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 95 | entry: check-yaml |
| 96 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 97 | types: [yaml] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 98 | - id: debug-statements |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 99 | name: debug statements (python) |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 100 | description: checks for debugger imports and py37+ `breakpoint()` calls in python source. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 101 | entry: debug-statement-hook |
| 102 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 103 | types: [python] |
Mikhail Khvoinitsky | 1e87d59 | 2020-08-02 21:25:07 +0300 | [diff] [blame] | 104 | - id: destroyed-symlinks |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 105 | name: detect destroyed symlinks |
| 106 | description: detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to. |
Mikhail Khvoinitsky | 1e87d59 | 2020-08-02 21:25:07 +0300 | [diff] [blame] | 107 | entry: destroyed-symlinks |
| 108 | language: python |
| 109 | types: [file] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 110 | - id: detect-aws-credentials |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 111 | name: detect aws credentials |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 112 | description: detects *your* aws credentials from the aws cli credentials file. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 113 | entry: detect-aws-credentials |
| 114 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 115 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 116 | - id: detect-private-key |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 117 | name: detect private key |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 118 | description: detects the presence of private keys. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 119 | entry: detect-private-key |
| 120 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 121 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 122 | - id: double-quote-string-fixer |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 123 | name: fix double quoted strings |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 124 | description: replaces double quoted strings with single quoted strings. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 125 | entry: double-quote-string-fixer |
| 126 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 127 | types: [python] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 128 | - id: end-of-file-fixer |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 129 | name: fix end of files |
| 130 | description: ensures that a file is either empty, or ends with one newline. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 131 | entry: end-of-file-fixer |
| 132 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 133 | types: [text] |
Iulian Onofrei | 5f6a443 | 2018-09-27 21:09:33 +0300 | [diff] [blame] | 134 | stages: [commit, push, manual] |
Daniel Gallagher | 9425c5d | 2017-06-23 00:33:13 -0700 | [diff] [blame] | 135 | - id: file-contents-sorter |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 136 | name: file contents sorter |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 137 | description: sorts the lines in specified files (defaults to alphabetical). you must provide list of target files as input in your .pre-commit-config.yaml file. |
Daniel Gallagher | 9425c5d | 2017-06-23 00:33:13 -0700 | [diff] [blame] | 138 | entry: file-contents-sorter |
| 139 | language: python |
Daniel Gallagher | b941d0e | 2017-06-23 14:58:24 -0700 | [diff] [blame] | 140 | files: '^$' |
Jeremiah Gowdy | d18bd5b | 2020-10-04 18:45:54 -0700 | [diff] [blame] | 141 | - id: fix-byte-order-marker |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 142 | name: fix utf-8 byte order marker |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 143 | description: removes utf-8 byte order marker. |
Jeremiah Gowdy | d18bd5b | 2020-10-04 18:45:54 -0700 | [diff] [blame] | 144 | entry: fix-byte-order-marker |
| 145 | language: python |
| 146 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 147 | - id: fix-encoding-pragma |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 148 | name: fix python encoding pragma |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 149 | description: 'adds # -*- coding: utf-8 -*- to the top of python files.' |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 150 | language: python |
| 151 | entry: fix-encoding-pragma |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 152 | types: [python] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 153 | - id: forbid-new-submodules |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 154 | name: forbid new submodules |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 155 | description: prevents addition of new git submodules. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 156 | language: python |
| 157 | entry: forbid-new-submodules |
Mikhail Khvoinitsky | 10c5e4e | 2021-06-23 03:10:13 +0300 | [diff] [blame] | 158 | types: [directory] |
Anthony Sottile | a9b6a7e | 2022-10-04 15:56:38 -0400 | [diff] [blame] | 159 | - id: forbid-submodules |
| 160 | name: forbid submodules |
| 161 | description: forbids any submodules in the repository |
| 162 | language: fail |
| 163 | entry: 'submodules are not allowed in this repository:' |
| 164 | types: [directory] |
Morgan Courbet | fc8a5b2 | 2017-06-13 21:38:14 +0200 | [diff] [blame] | 165 | - id: mixed-line-ending |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 166 | name: mixed line ending |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 167 | description: replaces or checks mixed line ending. |
Morgan Courbet | fc8a5b2 | 2017-06-13 21:38:14 +0200 | [diff] [blame] | 168 | entry: mixed-line-ending |
| 169 | language: python |
| 170 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 171 | - id: name-tests-test |
Anthony Sottile | 879055f | 2022-01-06 16:33:18 -0500 | [diff] [blame] | 172 | name: python tests naming |
Anthony Sottile | 412564f | 2022-06-07 09:10:42 -0700 | [diff] [blame] | 173 | description: verifies that test files are named correctly. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 174 | entry: name-tests-test |
| 175 | language: python |
Anthony Sottile | c5b56b6 | 2017-07-30 17:52:31 -0700 | [diff] [blame] | 176 | files: (^|/)tests/.+\.py$ |
Evan Felix | a859266 | 2017-03-20 10:36:51 -0700 | [diff] [blame] | 177 | - id: no-commit-to-branch |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 178 | name: "don't commit to branch" |
Evan Felix | a859266 | 2017-03-20 10:36:51 -0700 | [diff] [blame] | 179 | entry: no-commit-to-branch |
| 180 | language: python |
Anthony Sottile | 66eb9d3 | 2018-02-24 09:24:30 -0800 | [diff] [blame] | 181 | pass_filenames: false |
Evan Felix | a859266 | 2017-03-20 10:36:51 -0700 | [diff] [blame] | 182 | always_run: true |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 183 | - id: requirements-txt-fixer |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 184 | name: fix requirements.txt |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 185 | description: sorts entries in requirements.txt. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 186 | entry: requirements-txt-fixer |
| 187 | language: python |
Lev Blit | 03cb9e7 | 2023-01-14 13:27:25 +0200 | [diff] [blame] | 188 | files: (requirements|constraints).*\.txt$ |
Daniel Gallagher | b6eff3d | 2017-06-23 16:26:00 -0700 | [diff] [blame] | 189 | - id: sort-simple-yaml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 190 | name: sort simple yaml files |
Iulian Onofrei | 2006a4d | 2021-10-20 17:01:35 +0300 | [diff] [blame] | 191 | description: sorts simple yaml files which consist only of top-level keys, preserving comments and blocks. |
Daniel Gallagher | b6eff3d | 2017-06-23 16:26:00 -0700 | [diff] [blame] | 192 | language: python |
| 193 | entry: sort-simple-yaml |
Daniel Gallagher | b6eff3d | 2017-06-23 16:26:00 -0700 | [diff] [blame] | 194 | files: '^$' |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 195 | - id: trailing-whitespace |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 196 | name: trim trailing whitespace |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 197 | description: trims trailing whitespace. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 198 | entry: trailing-whitespace-fixer |
| 199 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 200 | types: [text] |
Iulian Onofrei | 93e3a4f | 2019-02-02 10:38:39 +0200 | [diff] [blame] | 201 | stages: [commit, push, manual] |