blob: c0d811caf05bd465ed7d4f7f0ca358414383801d [file] [log] [blame]
Anthony Sottile7752c422017-01-21 18:03:59 -08001- id: check-added-large-files
Dennis Rocheccaa20d2021-10-18 20:57:55 +08002 name: check for added large files
Iulian Onofreid7932b62021-07-27 09:19:00 +03003 description: prevents giant files from being committed.
Anthony Sottile7752c422017-01-21 18:03:59 -08004 entry: check-added-large-files
5 language: python
Anthony Sottiled17fe992022-06-06 12:24:03 -04006 stages: [commit, push, manual]
Anthony Sottile7752c422017-01-21 18:03:59 -08007- id: check-ast
Dennis Rocheccaa20d2021-10-18 20:57:55 +08008 name: check python ast
Iulian Onofreid7932b62021-07-27 09:19:00 +03009 description: simply checks whether the files parse as valid python.
Anthony Sottile7752c422017-01-21 18:03:59 -080010 entry: check-ast
11 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070012 types: [python]
Anthony Sottile7752c422017-01-21 18:03:59 -080013- id: check-byte-order-marker
Jeremiah Gowdyd18bd5b2020-10-04 18:45:54 -070014 name: 'check BOM - deprecated: use fix-byte-order-marker'
Iulian Onofreid7932b62021-07-27 09:19:00 +030015 description: forbids files which have a utf-8 byte-order marker.
Anthony Sottile7752c422017-01-21 18:03:59 -080016 entry: check-byte-order-marker
17 language: python
Toby Fleming841c47e2019-03-21 16:33:00 -070018 types: [text]
Ben Webber35996b72017-11-26 00:17:47 +000019- id: check-builtin-literals
Dennis Rocheccaa20d2021-10-18 20:57:55 +080020 name: check builtin type constructor use
Iulian Onofreid7932b62021-07-27 09:19:00 +030021 description: requires literal syntax when initializing empty or zero python builtin types.
Ben Webber35996b72017-11-26 00:17:47 +000022 entry: check-builtin-literals
23 language: python
24 types: [python]
Anthony Sottile7752c422017-01-21 18:03:59 -080025- id: check-case-conflict
Dennis Rocheccaa20d2021-10-18 20:57:55 +080026 name: check for case conflicts
Iulian Onofreid7932b62021-07-27 09:19:00 +030027 description: checks for files that would conflict in case-insensitive filesystems.
Anthony Sottile7752c422017-01-21 18:03:59 -080028 entry: check-case-conflict
29 language: python
Anthony Sottile7752c422017-01-21 18:03:59 -080030- id: check-docstring-first
Dennis Rocheccaa20d2021-10-18 20:57:55 +080031 name: check docstring is first
32 description: checks a common error of defining a docstring after code.
Anthony Sottile7752c422017-01-21 18:03:59 -080033 entry: check-docstring-first
34 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070035 types: [python]
Chris Kuehl13991f02017-07-02 21:00:28 -070036- id: check-executables-have-shebangs
Dennis Rocheccaa20d2021-10-18 20:57:55 +080037 name: check that executables have shebangs
38 description: ensures that (non-binary) executables have a shebang.
Chris Kuehl13991f02017-07-02 21:00:28 -070039 entry: check-executables-have-shebangs
40 language: python
41 types: [text, executable]
Iulian Onofrei93e3a4f2019-02-02 10:38:39 +020042 stages: [commit, push, manual]
Anthony Sottile7752c422017-01-21 18:03:59 -080043- id: check-json
Dennis Rocheccaa20d2021-10-18 20:57:55 +080044 name: check json
Iulian Onofreid7932b62021-07-27 09:19:00 +030045 description: checks json files for parseable syntax.
Anthony Sottile7752c422017-01-21 18:03:59 -080046 entry: check-json
47 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070048 types: [json]
Ville Skyttä391ae302021-01-08 17:36:55 +020049- id: check-shebang-scripts-are-executable
Dennis Rocheccaa20d2021-10-18 20:57:55 +080050 name: check that scripts with shebangs are executable
51 description: ensures that (non-binary) files with a shebang are executable.
Ville Skyttä391ae302021-01-08 17:36:55 +020052 entry: check-shebang-scripts-are-executable
53 language: python
54 types: [text]
55 stages: [commit, push, manual]
Anthony Sottile7752c422017-01-21 18:03:59 -080056- id: pretty-format-json
Dennis Rocheccaa20d2021-10-18 20:57:55 +080057 name: pretty format json
Iulian Onofreid7932b62021-07-27 09:19:00 +030058 description: sets a standard for formatting json files.
Anthony Sottile7752c422017-01-21 18:03:59 -080059 entry: pretty-format-json
60 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070061 types: [json]
Anthony Sottile7752c422017-01-21 18:03:59 -080062- id: check-merge-conflict
Dennis Rocheccaa20d2021-10-18 20:57:55 +080063 name: check for merge conflicts
Iulian Onofreid7932b62021-07-27 09:19:00 +030064 description: checks for files that contain merge conflict strings.
Anthony Sottile7752c422017-01-21 18:03:59 -080065 entry: check-merge-conflict
66 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070067 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -080068- id: check-symlinks
Dennis Rocheccaa20d2021-10-18 20:57:55 +080069 name: check for broken symlinks
70 description: checks for symlinks which do not point to anything.
Anthony Sottile7752c422017-01-21 18:03:59 -080071 entry: check-symlinks
72 language: python
Anthony Sottilec4720432017-07-02 19:55:58 -070073 types: [symlink]
Semyon Maryasinae70f7e2019-03-28 01:13:45 +030074- id: check-toml
Dennis Rocheccaa20d2021-10-18 20:57:55 +080075 name: check toml
Iulian Onofreid7932b62021-07-27 09:19:00 +030076 description: checks toml files for parseable syntax.
Semyon Maryasinae70f7e2019-03-28 01:13:45 +030077 entry: check-toml
78 language: python
79 types: [toml]
Anthony Sottile9db0a742017-10-06 23:32:11 -070080- id: check-vcs-permalinks
Dennis Rocheccaa20d2021-10-18 20:57:55 +080081 name: check vcs permalinks
82 description: ensures that links to vcs websites are permalinks.
Anthony Sottile9db0a742017-10-06 23:32:11 -070083 entry: check-vcs-permalinks
84 language: python
85 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -080086- id: check-xml
Dennis Rocheccaa20d2021-10-18 20:57:55 +080087 name: check xml
Iulian Onofreid7932b62021-07-27 09:19:00 +030088 description: checks xml files for parseable syntax.
Anthony Sottile7752c422017-01-21 18:03:59 -080089 entry: check-xml
90 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070091 types: [xml]
Anthony Sottile7752c422017-01-21 18:03:59 -080092- id: check-yaml
Dennis Rocheccaa20d2021-10-18 20:57:55 +080093 name: check yaml
Iulian Onofreid7932b62021-07-27 09:19:00 +030094 description: checks yaml files for parseable syntax.
Anthony Sottile7752c422017-01-21 18:03:59 -080095 entry: check-yaml
96 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070097 types: [yaml]
Anthony Sottile7752c422017-01-21 18:03:59 -080098- id: debug-statements
Dennis Rocheccaa20d2021-10-18 20:57:55 +080099 name: debug statements (python)
Iulian Onofreid7932b62021-07-27 09:19:00 +0300100 description: checks for debugger imports and py37+ `breakpoint()` calls in python source.
Anthony Sottile7752c422017-01-21 18:03:59 -0800101 entry: debug-statement-hook
102 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700103 types: [python]
Mikhail Khvoinitsky1e87d592020-08-02 21:25:07 +0300104- id: destroyed-symlinks
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800105 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 Khvoinitsky1e87d592020-08-02 21:25:07 +0300107 entry: destroyed-symlinks
108 language: python
109 types: [file]
Anthony Sottile7752c422017-01-21 18:03:59 -0800110- id: detect-aws-credentials
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800111 name: detect aws credentials
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300112 description: detects *your* aws credentials from the aws cli credentials file.
Anthony Sottile7752c422017-01-21 18:03:59 -0800113 entry: detect-aws-credentials
114 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700115 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800116- id: detect-private-key
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800117 name: detect private key
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300118 description: detects the presence of private keys.
Anthony Sottile7752c422017-01-21 18:03:59 -0800119 entry: detect-private-key
120 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700121 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800122- id: double-quote-string-fixer
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800123 name: fix double quoted strings
Iulian Onofreid7932b62021-07-27 09:19:00 +0300124 description: replaces double quoted strings with single quoted strings.
Anthony Sottile7752c422017-01-21 18:03:59 -0800125 entry: double-quote-string-fixer
126 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700127 types: [python]
Anthony Sottile7752c422017-01-21 18:03:59 -0800128- id: end-of-file-fixer
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800129 name: fix end of files
130 description: ensures that a file is either empty, or ends with one newline.
Anthony Sottile7752c422017-01-21 18:03:59 -0800131 entry: end-of-file-fixer
132 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700133 types: [text]
Iulian Onofrei5f6a4432018-09-27 21:09:33 +0300134 stages: [commit, push, manual]
Daniel Gallagher9425c5d2017-06-23 00:33:13 -0700135- id: file-contents-sorter
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800136 name: file contents sorter
Iulian Onofreid7932b62021-07-27 09:19:00 +0300137 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 Gallagher9425c5d2017-06-23 00:33:13 -0700138 entry: file-contents-sorter
139 language: python
Daniel Gallagherb941d0e2017-06-23 14:58:24 -0700140 files: '^$'
Jeremiah Gowdyd18bd5b2020-10-04 18:45:54 -0700141- id: fix-byte-order-marker
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800142 name: fix utf-8 byte order marker
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300143 description: removes utf-8 byte order marker.
Jeremiah Gowdyd18bd5b2020-10-04 18:45:54 -0700144 entry: fix-byte-order-marker
145 language: python
146 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800147- id: fix-encoding-pragma
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800148 name: fix python encoding pragma
Iulian Onofreid7932b62021-07-27 09:19:00 +0300149 description: 'adds # -*- coding: utf-8 -*- to the top of python files.'
Anthony Sottile7752c422017-01-21 18:03:59 -0800150 language: python
151 entry: fix-encoding-pragma
Anthony Sottileabea6d22017-07-02 20:57:10 -0700152 types: [python]
Anthony Sottile7752c422017-01-21 18:03:59 -0800153- id: forbid-new-submodules
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800154 name: forbid new submodules
Iulian Onofreid7932b62021-07-27 09:19:00 +0300155 description: prevents addition of new git submodules.
Anthony Sottile7752c422017-01-21 18:03:59 -0800156 language: python
157 entry: forbid-new-submodules
Mikhail Khvoinitsky10c5e4e2021-06-23 03:10:13 +0300158 types: [directory]
Anthony Sottilea9b6a7e2022-10-04 15:56:38 -0400159- 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 Courbetfc8a5b22017-06-13 21:38:14 +0200165- id: mixed-line-ending
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800166 name: mixed line ending
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300167 description: replaces or checks mixed line ending.
Morgan Courbetfc8a5b22017-06-13 21:38:14 +0200168 entry: mixed-line-ending
169 language: python
170 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800171- id: name-tests-test
Anthony Sottile879055f2022-01-06 16:33:18 -0500172 name: python tests naming
Anthony Sottile412564f2022-06-07 09:10:42 -0700173 description: verifies that test files are named correctly.
Anthony Sottile7752c422017-01-21 18:03:59 -0800174 entry: name-tests-test
175 language: python
Anthony Sottilec5b56b62017-07-30 17:52:31 -0700176 files: (^|/)tests/.+\.py$
Evan Felixa8592662017-03-20 10:36:51 -0700177- id: no-commit-to-branch
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800178 name: "don't commit to branch"
Evan Felixa8592662017-03-20 10:36:51 -0700179 entry: no-commit-to-branch
180 language: python
Anthony Sottile66eb9d32018-02-24 09:24:30 -0800181 pass_filenames: false
Evan Felixa8592662017-03-20 10:36:51 -0700182 always_run: true
Anthony Sottile7752c422017-01-21 18:03:59 -0800183- id: requirements-txt-fixer
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800184 name: fix requirements.txt
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300185 description: sorts entries in requirements.txt.
Anthony Sottile7752c422017-01-21 18:03:59 -0800186 entry: requirements-txt-fixer
187 language: python
Lev Blit03cb9e72023-01-14 13:27:25 +0200188 files: (requirements|constraints).*\.txt$
Daniel Gallagherb6eff3d2017-06-23 16:26:00 -0700189- id: sort-simple-yaml
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800190 name: sort simple yaml files
Iulian Onofrei2006a4d2021-10-20 17:01:35 +0300191 description: sorts simple yaml files which consist only of top-level keys, preserving comments and blocks.
Daniel Gallagherb6eff3d2017-06-23 16:26:00 -0700192 language: python
193 entry: sort-simple-yaml
Daniel Gallagherb6eff3d2017-06-23 16:26:00 -0700194 files: '^$'
Anthony Sottile7752c422017-01-21 18:03:59 -0800195- id: trailing-whitespace
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800196 name: trim trailing whitespace
Iulian Onofreid7932b62021-07-27 09:19:00 +0300197 description: trims trailing whitespace.
Anthony Sottile7752c422017-01-21 18:03:59 -0800198 entry: trailing-whitespace-fixer
199 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700200 types: [text]
Iulian Onofrei93e3a4f2019-02-02 10:38:39 +0200201 stages: [commit, push, manual]