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] |
Eric L Frederich | 8654097 | 2021-04-22 08:51:03 -0400 | [diff] [blame] | 43 | - id: check-illegal-windows-names |
| 44 | name: check illegal windows names |
| 45 | entry: Illegal windows filenames detected |
| 46 | language: fail |
Eric L Frederich | 714f1e5 | 2024-04-16 14:43:15 -0400 | [diff] [blame] | 47 | files: '(?i)((^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)|:)' |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 48 | - id: check-json |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 49 | name: check json |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 50 | description: checks json files for parseable syntax. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 51 | entry: check-json |
| 52 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 53 | types: [json] |
Ville Skyttä | 391ae30 | 2021-01-08 17:36:55 +0200 | [diff] [blame] | 54 | - id: check-shebang-scripts-are-executable |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 55 | name: check that scripts with shebangs are executable |
| 56 | description: ensures that (non-binary) files with a shebang are executable. |
Ville Skyttä | 391ae30 | 2021-01-08 17:36:55 +0200 | [diff] [blame] | 57 | entry: check-shebang-scripts-are-executable |
| 58 | language: python |
| 59 | types: [text] |
| 60 | stages: [commit, push, manual] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 61 | - id: pretty-format-json |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 62 | name: pretty format json |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 63 | description: sets a standard for formatting json files. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 64 | entry: pretty-format-json |
| 65 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 66 | types: [json] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 67 | - id: check-merge-conflict |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 68 | name: check for merge conflicts |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 69 | description: checks for files that contain merge conflict strings. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 70 | entry: check-merge-conflict |
| 71 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 72 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 73 | - id: check-symlinks |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 74 | name: check for broken symlinks |
| 75 | description: checks for symlinks which do not point to anything. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 76 | entry: check-symlinks |
| 77 | language: python |
Anthony Sottile | c472043 | 2017-07-02 19:55:58 -0700 | [diff] [blame] | 78 | types: [symlink] |
Semyon Maryasin | ae70f7e | 2019-03-28 01:13:45 +0300 | [diff] [blame] | 79 | - id: check-toml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 80 | name: check toml |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 81 | description: checks toml files for parseable syntax. |
Semyon Maryasin | ae70f7e | 2019-03-28 01:13:45 +0300 | [diff] [blame] | 82 | entry: check-toml |
| 83 | language: python |
| 84 | types: [toml] |
Anthony Sottile | 9db0a74 | 2017-10-06 23:32:11 -0700 | [diff] [blame] | 85 | - id: check-vcs-permalinks |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 86 | name: check vcs permalinks |
| 87 | description: ensures that links to vcs websites are permalinks. |
Anthony Sottile | 9db0a74 | 2017-10-06 23:32:11 -0700 | [diff] [blame] | 88 | entry: check-vcs-permalinks |
| 89 | language: python |
| 90 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 91 | - id: check-xml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 92 | name: check xml |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 93 | description: checks xml files for parseable syntax. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 94 | entry: check-xml |
| 95 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 96 | types: [xml] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 97 | - id: check-yaml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 98 | name: check yaml |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 99 | description: checks yaml files for parseable syntax. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 100 | entry: check-yaml |
| 101 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 102 | types: [yaml] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 103 | - id: debug-statements |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 104 | name: debug statements (python) |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 105 | description: checks for debugger imports and py37+ `breakpoint()` calls in python source. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 106 | entry: debug-statement-hook |
| 107 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 108 | types: [python] |
Mikhail Khvoinitsky | 1e87d59 | 2020-08-02 21:25:07 +0300 | [diff] [blame] | 109 | - id: destroyed-symlinks |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 110 | name: detect destroyed symlinks |
| 111 | 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] | 112 | entry: destroyed-symlinks |
| 113 | language: python |
| 114 | types: [file] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 115 | - id: detect-aws-credentials |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 116 | name: detect aws credentials |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 117 | description: detects *your* aws credentials from the aws cli credentials file. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 118 | entry: detect-aws-credentials |
| 119 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 120 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 121 | - id: detect-private-key |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 122 | name: detect private key |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 123 | description: detects the presence of private keys. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 124 | entry: detect-private-key |
| 125 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 126 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 127 | - id: double-quote-string-fixer |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 128 | name: fix double quoted strings |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 129 | description: replaces double quoted strings with single quoted strings. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 130 | entry: double-quote-string-fixer |
| 131 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 132 | types: [python] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 133 | - id: end-of-file-fixer |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 134 | name: fix end of files |
| 135 | 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] | 136 | entry: end-of-file-fixer |
| 137 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 138 | types: [text] |
Iulian Onofrei | 5f6a443 | 2018-09-27 21:09:33 +0300 | [diff] [blame] | 139 | stages: [commit, push, manual] |
Daniel Gallagher | 9425c5d | 2017-06-23 00:33:13 -0700 | [diff] [blame] | 140 | - id: file-contents-sorter |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 141 | name: file contents sorter |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 142 | 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] | 143 | entry: file-contents-sorter |
| 144 | language: python |
Daniel Gallagher | b941d0e | 2017-06-23 14:58:24 -0700 | [diff] [blame] | 145 | files: '^$' |
Jeremiah Gowdy | d18bd5b | 2020-10-04 18:45:54 -0700 | [diff] [blame] | 146 | - id: fix-byte-order-marker |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 147 | name: fix utf-8 byte order marker |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 148 | description: removes utf-8 byte order marker. |
Jeremiah Gowdy | d18bd5b | 2020-10-04 18:45:54 -0700 | [diff] [blame] | 149 | entry: fix-byte-order-marker |
| 150 | language: python |
| 151 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 152 | - id: fix-encoding-pragma |
Max R | cef973f | 2024-04-02 11:11:58 -0400 | [diff] [blame] | 153 | name: fix python encoding pragma (deprecated) |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 154 | description: 'adds # -*- coding: utf-8 -*- to the top of python files.' |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 155 | language: python |
| 156 | entry: fix-encoding-pragma |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 157 | types: [python] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 158 | - id: forbid-new-submodules |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 159 | name: forbid new submodules |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 160 | description: prevents addition of new git submodules. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 161 | language: python |
| 162 | entry: forbid-new-submodules |
Mikhail Khvoinitsky | 10c5e4e | 2021-06-23 03:10:13 +0300 | [diff] [blame] | 163 | types: [directory] |
Anthony Sottile | a9b6a7e | 2022-10-04 15:56:38 -0400 | [diff] [blame] | 164 | - id: forbid-submodules |
| 165 | name: forbid submodules |
| 166 | description: forbids any submodules in the repository |
| 167 | language: fail |
| 168 | entry: 'submodules are not allowed in this repository:' |
| 169 | types: [directory] |
Morgan Courbet | fc8a5b2 | 2017-06-13 21:38:14 +0200 | [diff] [blame] | 170 | - id: mixed-line-ending |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 171 | name: mixed line ending |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 172 | description: replaces or checks mixed line ending. |
Morgan Courbet | fc8a5b2 | 2017-06-13 21:38:14 +0200 | [diff] [blame] | 173 | entry: mixed-line-ending |
| 174 | language: python |
| 175 | types: [text] |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 176 | - id: name-tests-test |
Anthony Sottile | 879055f | 2022-01-06 16:33:18 -0500 | [diff] [blame] | 177 | name: python tests naming |
Anthony Sottile | 412564f | 2022-06-07 09:10:42 -0700 | [diff] [blame] | 178 | description: verifies that test files are named correctly. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 179 | entry: name-tests-test |
| 180 | language: python |
Anthony Sottile | c5b56b6 | 2017-07-30 17:52:31 -0700 | [diff] [blame] | 181 | files: (^|/)tests/.+\.py$ |
Evan Felix | a859266 | 2017-03-20 10:36:51 -0700 | [diff] [blame] | 182 | - id: no-commit-to-branch |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 183 | name: "don't commit to branch" |
Evan Felix | a859266 | 2017-03-20 10:36:51 -0700 | [diff] [blame] | 184 | entry: no-commit-to-branch |
| 185 | language: python |
Anthony Sottile | 66eb9d3 | 2018-02-24 09:24:30 -0800 | [diff] [blame] | 186 | pass_filenames: false |
Evan Felix | a859266 | 2017-03-20 10:36:51 -0700 | [diff] [blame] | 187 | always_run: true |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 188 | - id: requirements-txt-fixer |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 189 | name: fix requirements.txt |
Iulian Onofrei | 8a1d0fc | 2021-10-20 17:01:40 +0300 | [diff] [blame] | 190 | description: sorts entries in requirements.txt. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 191 | entry: requirements-txt-fixer |
| 192 | language: python |
Lev Blit | 03cb9e7 | 2023-01-14 13:27:25 +0200 | [diff] [blame] | 193 | files: (requirements|constraints).*\.txt$ |
Daniel Gallagher | b6eff3d | 2017-06-23 16:26:00 -0700 | [diff] [blame] | 194 | - id: sort-simple-yaml |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 195 | name: sort simple yaml files |
Iulian Onofrei | 2006a4d | 2021-10-20 17:01:35 +0300 | [diff] [blame] | 196 | 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] | 197 | language: python |
| 198 | entry: sort-simple-yaml |
Daniel Gallagher | b6eff3d | 2017-06-23 16:26:00 -0700 | [diff] [blame] | 199 | files: '^$' |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 200 | - id: trailing-whitespace |
Dennis Roche | ccaa20d | 2021-10-18 20:57:55 +0800 | [diff] [blame] | 201 | name: trim trailing whitespace |
Iulian Onofrei | d7932b6 | 2021-07-27 09:19:00 +0300 | [diff] [blame] | 202 | description: trims trailing whitespace. |
Anthony Sottile | 7752c42 | 2017-01-21 18:03:59 -0800 | [diff] [blame] | 203 | entry: trailing-whitespace-fixer |
| 204 | language: python |
Anthony Sottile | abea6d2 | 2017-07-02 20:57:10 -0700 | [diff] [blame] | 205 | types: [text] |
Iulian Onofrei | 93e3a4f | 2019-02-02 10:38:39 +0200 | [diff] [blame] | 206 | stages: [commit, push, manual] |