blob: 44a8648d4f522cdb7b17f2e2977c8e0191986053 [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]
Eric L Frederich86540972021-04-22 08:51:03 -040043- id: check-illegal-windows-names
44 name: check illegal windows names
45 entry: Illegal windows filenames detected
46 language: fail
Eric L Frederich714f1e52024-04-16 14:43:15 -040047 files: '(?i)((^|/)(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])(\.|/|$)|:)'
Anthony Sottile7752c422017-01-21 18:03:59 -080048- id: check-json
Dennis Rocheccaa20d2021-10-18 20:57:55 +080049 name: check json
Iulian Onofreid7932b62021-07-27 09:19:00 +030050 description: checks json files for parseable syntax.
Anthony Sottile7752c422017-01-21 18:03:59 -080051 entry: check-json
52 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070053 types: [json]
Ville Skyttä391ae302021-01-08 17:36:55 +020054- id: check-shebang-scripts-are-executable
Dennis Rocheccaa20d2021-10-18 20:57:55 +080055 name: check that scripts with shebangs are executable
56 description: ensures that (non-binary) files with a shebang are executable.
Ville Skyttä391ae302021-01-08 17:36:55 +020057 entry: check-shebang-scripts-are-executable
58 language: python
59 types: [text]
60 stages: [commit, push, manual]
Anthony Sottile7752c422017-01-21 18:03:59 -080061- id: pretty-format-json
Dennis Rocheccaa20d2021-10-18 20:57:55 +080062 name: pretty format json
Iulian Onofreid7932b62021-07-27 09:19:00 +030063 description: sets a standard for formatting json files.
Anthony Sottile7752c422017-01-21 18:03:59 -080064 entry: pretty-format-json
65 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070066 types: [json]
Anthony Sottile7752c422017-01-21 18:03:59 -080067- id: check-merge-conflict
Dennis Rocheccaa20d2021-10-18 20:57:55 +080068 name: check for merge conflicts
Iulian Onofreid7932b62021-07-27 09:19:00 +030069 description: checks for files that contain merge conflict strings.
Anthony Sottile7752c422017-01-21 18:03:59 -080070 entry: check-merge-conflict
71 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070072 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -080073- id: check-symlinks
Dennis Rocheccaa20d2021-10-18 20:57:55 +080074 name: check for broken symlinks
75 description: checks for symlinks which do not point to anything.
Anthony Sottile7752c422017-01-21 18:03:59 -080076 entry: check-symlinks
77 language: python
Anthony Sottilec4720432017-07-02 19:55:58 -070078 types: [symlink]
Semyon Maryasinae70f7e2019-03-28 01:13:45 +030079- id: check-toml
Dennis Rocheccaa20d2021-10-18 20:57:55 +080080 name: check toml
Iulian Onofreid7932b62021-07-27 09:19:00 +030081 description: checks toml files for parseable syntax.
Semyon Maryasinae70f7e2019-03-28 01:13:45 +030082 entry: check-toml
83 language: python
84 types: [toml]
Anthony Sottile9db0a742017-10-06 23:32:11 -070085- id: check-vcs-permalinks
Dennis Rocheccaa20d2021-10-18 20:57:55 +080086 name: check vcs permalinks
87 description: ensures that links to vcs websites are permalinks.
Anthony Sottile9db0a742017-10-06 23:32:11 -070088 entry: check-vcs-permalinks
89 language: python
90 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -080091- id: check-xml
Dennis Rocheccaa20d2021-10-18 20:57:55 +080092 name: check xml
Iulian Onofreid7932b62021-07-27 09:19:00 +030093 description: checks xml files for parseable syntax.
Anthony Sottile7752c422017-01-21 18:03:59 -080094 entry: check-xml
95 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -070096 types: [xml]
Anthony Sottile7752c422017-01-21 18:03:59 -080097- id: check-yaml
Dennis Rocheccaa20d2021-10-18 20:57:55 +080098 name: check yaml
Iulian Onofreid7932b62021-07-27 09:19:00 +030099 description: checks yaml files for parseable syntax.
Anthony Sottile7752c422017-01-21 18:03:59 -0800100 entry: check-yaml
101 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700102 types: [yaml]
Anthony Sottile7752c422017-01-21 18:03:59 -0800103- id: debug-statements
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800104 name: debug statements (python)
Iulian Onofreid7932b62021-07-27 09:19:00 +0300105 description: checks for debugger imports and py37+ `breakpoint()` calls in python source.
Anthony Sottile7752c422017-01-21 18:03:59 -0800106 entry: debug-statement-hook
107 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700108 types: [python]
Mikhail Khvoinitsky1e87d592020-08-02 21:25:07 +0300109- id: destroyed-symlinks
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800110 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 Khvoinitsky1e87d592020-08-02 21:25:07 +0300112 entry: destroyed-symlinks
113 language: python
114 types: [file]
Anthony Sottile7752c422017-01-21 18:03:59 -0800115- id: detect-aws-credentials
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800116 name: detect aws credentials
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300117 description: detects *your* aws credentials from the aws cli credentials file.
Anthony Sottile7752c422017-01-21 18:03:59 -0800118 entry: detect-aws-credentials
119 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700120 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800121- id: detect-private-key
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800122 name: detect private key
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300123 description: detects the presence of private keys.
Anthony Sottile7752c422017-01-21 18:03:59 -0800124 entry: detect-private-key
125 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700126 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800127- id: double-quote-string-fixer
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800128 name: fix double quoted strings
Iulian Onofreid7932b62021-07-27 09:19:00 +0300129 description: replaces double quoted strings with single quoted strings.
Anthony Sottile7752c422017-01-21 18:03:59 -0800130 entry: double-quote-string-fixer
131 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700132 types: [python]
Anthony Sottile7752c422017-01-21 18:03:59 -0800133- id: end-of-file-fixer
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800134 name: fix end of files
135 description: ensures that a file is either empty, or ends with one newline.
Anthony Sottile7752c422017-01-21 18:03:59 -0800136 entry: end-of-file-fixer
137 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700138 types: [text]
Iulian Onofrei5f6a4432018-09-27 21:09:33 +0300139 stages: [commit, push, manual]
Daniel Gallagher9425c5d2017-06-23 00:33:13 -0700140- id: file-contents-sorter
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800141 name: file contents sorter
Iulian Onofreid7932b62021-07-27 09:19:00 +0300142 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 -0700143 entry: file-contents-sorter
144 language: python
Daniel Gallagherb941d0e2017-06-23 14:58:24 -0700145 files: '^$'
Jeremiah Gowdyd18bd5b2020-10-04 18:45:54 -0700146- id: fix-byte-order-marker
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800147 name: fix utf-8 byte order marker
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300148 description: removes utf-8 byte order marker.
Jeremiah Gowdyd18bd5b2020-10-04 18:45:54 -0700149 entry: fix-byte-order-marker
150 language: python
151 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800152- id: fix-encoding-pragma
Max Rcef973f2024-04-02 11:11:58 -0400153 name: fix python encoding pragma (deprecated)
Iulian Onofreid7932b62021-07-27 09:19:00 +0300154 description: 'adds # -*- coding: utf-8 -*- to the top of python files.'
Anthony Sottile7752c422017-01-21 18:03:59 -0800155 language: python
156 entry: fix-encoding-pragma
Anthony Sottileabea6d22017-07-02 20:57:10 -0700157 types: [python]
Anthony Sottile7752c422017-01-21 18:03:59 -0800158- id: forbid-new-submodules
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800159 name: forbid new submodules
Iulian Onofreid7932b62021-07-27 09:19:00 +0300160 description: prevents addition of new git submodules.
Anthony Sottile7752c422017-01-21 18:03:59 -0800161 language: python
162 entry: forbid-new-submodules
Mikhail Khvoinitsky10c5e4e2021-06-23 03:10:13 +0300163 types: [directory]
Anthony Sottilea9b6a7e2022-10-04 15:56:38 -0400164- 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 Courbetfc8a5b22017-06-13 21:38:14 +0200170- id: mixed-line-ending
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800171 name: mixed line ending
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300172 description: replaces or checks mixed line ending.
Morgan Courbetfc8a5b22017-06-13 21:38:14 +0200173 entry: mixed-line-ending
174 language: python
175 types: [text]
Anthony Sottile7752c422017-01-21 18:03:59 -0800176- id: name-tests-test
Anthony Sottile879055f2022-01-06 16:33:18 -0500177 name: python tests naming
Anthony Sottile412564f2022-06-07 09:10:42 -0700178 description: verifies that test files are named correctly.
Anthony Sottile7752c422017-01-21 18:03:59 -0800179 entry: name-tests-test
180 language: python
Anthony Sottilec5b56b62017-07-30 17:52:31 -0700181 files: (^|/)tests/.+\.py$
Evan Felixa8592662017-03-20 10:36:51 -0700182- id: no-commit-to-branch
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800183 name: "don't commit to branch"
Evan Felixa8592662017-03-20 10:36:51 -0700184 entry: no-commit-to-branch
185 language: python
Anthony Sottile66eb9d32018-02-24 09:24:30 -0800186 pass_filenames: false
Evan Felixa8592662017-03-20 10:36:51 -0700187 always_run: true
Anthony Sottile7752c422017-01-21 18:03:59 -0800188- id: requirements-txt-fixer
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800189 name: fix requirements.txt
Iulian Onofrei8a1d0fc2021-10-20 17:01:40 +0300190 description: sorts entries in requirements.txt.
Anthony Sottile7752c422017-01-21 18:03:59 -0800191 entry: requirements-txt-fixer
192 language: python
Lev Blit03cb9e72023-01-14 13:27:25 +0200193 files: (requirements|constraints).*\.txt$
Daniel Gallagherb6eff3d2017-06-23 16:26:00 -0700194- id: sort-simple-yaml
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800195 name: sort simple yaml files
Iulian Onofrei2006a4d2021-10-20 17:01:35 +0300196 description: sorts simple yaml files which consist only of top-level keys, preserving comments and blocks.
Daniel Gallagherb6eff3d2017-06-23 16:26:00 -0700197 language: python
198 entry: sort-simple-yaml
Daniel Gallagherb6eff3d2017-06-23 16:26:00 -0700199 files: '^$'
Anthony Sottile7752c422017-01-21 18:03:59 -0800200- id: trailing-whitespace
Dennis Rocheccaa20d2021-10-18 20:57:55 +0800201 name: trim trailing whitespace
Iulian Onofreid7932b62021-07-27 09:19:00 +0300202 description: trims trailing whitespace.
Anthony Sottile7752c422017-01-21 18:03:59 -0800203 entry: trailing-whitespace-fixer
204 language: python
Anthony Sottileabea6d22017-07-02 20:57:10 -0700205 types: [text]
Iulian Onofrei93e3a4f2019-02-02 10:38:39 +0200206 stages: [commit, push, manual]