@@ -44,9 +44,9 @@ https://devenv.sh/pre-commit-hooks/
44
44
ormolu.enable = true;
45
45
shellcheck.enable = true;
46
46
};
47
-
48
- # Set the pkgs to get the tools for the hooks from.
49
- # tools = pkgs;
47
+
48
+ # Set the pkgs to get the tools for the hooks from.
49
+ # tools = pkgs;
50
50
51
51
# Some hooks offer custom settings that affect how they execute
52
52
settings = {
@@ -159,6 +159,13 @@ use nix
159
159
- [ pyupgrade] ( https://github.com/asottile/pyupgrade )
160
160
- [ pylint] ( https://github.com/PyCQA/pylint )
161
161
- [ flake8] ( https://github.com/PyCQA/flake8 )
162
+ - [ python-debug-statements] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/debug_statement_hook.py )
163
+ - [ check-builtin-literals] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_builtin_literals.py )
164
+ - [ check-docstring-first] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_docstring_first.py )
165
+ - [ check-python] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_ast.py )
166
+ - [ name-tests-test] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/tests_should_end_in_test.py )
167
+ - [ sort-requirements-txt] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/requirements_txt_fixer.py )
168
+ - [ fix-encoding-pragma] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/fix_encoding_pragma.py )
162
169
163
170
## PHP
164
171
@@ -222,10 +229,19 @@ use nix
222
229
## YAML
223
230
224
231
- [ yamllint] ( https://github.com/adrienverge/yamllint )
232
+ - [ check-yaml] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_yaml.py )
233
+ - [ sort-simple-yaml] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/sort_simple_yaml.py )
225
234
226
235
## TOML
227
236
228
237
- [ taplo fmt] ( https://github.com/tamasfe/taplo )
238
+ - [ check-toml] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_toml.py )
239
+
240
+
241
+ ## JSON
242
+
243
+ - [ check-json] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_json.py )
244
+ - [ pretty-format-json] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/pretty_format_json.py )
229
245
230
246
## Typst
231
247
@@ -241,7 +257,7 @@ use nix
241
257
- [ typos] ( https://github.com/crate-ci/typos )
242
258
- [ cspell] ( https://cspell.org/ )
243
259
244
- ## Other Formatters
260
+ ## Various other hooks
245
261
246
262
- [ prettier] ( https://prettier.io )
247
263
- ` dhall format ` : built-in formatter
@@ -256,6 +272,20 @@ use nix
256
272
- [ headache] ( https://github.com/frama-c/headache )
257
273
- [ crystal] ( https://crystal-lang.org/reference/man/crystal#crystal-tool-format )
258
274
- [ cmake-format] ( https://cmake-format.readthedocs.io/en/latest/ )
275
+ - [ sort-file-contents] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/file_contents_sorter.py )
276
+ - [ mixed-line-endings] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/mixed_line_ending.py )
277
+ - [ trim-trailing-whitespace] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/trailing_whitespace_fixer.py )
278
+ - [ check-case-conflicts] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_case_conflict.py )
279
+ - [ check-added-large-files] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_added_large_files.py )
280
+ - [ end-of-file-fixer] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/end_of_file_fixer.py )
281
+ - [ detect-aws-credentials] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/detect_aws_credentials.py )
282
+ - [ detect-private-keys] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/detect_private_key.py )
283
+ - [ check-shebang-scripts-are-executable] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_shebang_scripts_are_executable.py )
284
+ - [ check-executables-have-shebangs] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_executables_have_shebangs.py )
285
+ - [ check-symlinks] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_symlinks.py )
286
+ - [ check-vcs-permalinks] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_vcs_permalinks.py )
287
+ - [ check-xml] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_xml.py )
288
+ - [ fix-byte-order-marker] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/fix_byte_order_marker.py )
259
289
260
290
You may restrict which languages should be formatted by ` clang-format ` using
261
291
` clang-format.types_or ` . For example to check only C and C++ files:
@@ -267,7 +297,7 @@ clang-format = {
267
297
};
268
298
```
269
299
270
- Otherwise, the default internal list is used which includes everything that
300
+ Otherwise, the default internal list is used which includes everything that
271
301
clang-format supports.
272
302
273
303
## Git
@@ -276,6 +306,10 @@ clang-format supports.
276
306
- [ gptcommit] ( https://github.com/zurawiki/gptcommit )
277
307
- [ convco] ( https://github.com/convco/convco )
278
308
- [ annex] ( https://git-annex.branchable.com/ )
309
+ - [ no-commit-to-branch] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/no_commit_to_branch.py )
310
+ - [ check-merge-conflicts] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/check_merge_conflict.py )
311
+ - [ forbid-new-submodules] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/forbid_new_submodules.py )
312
+ - [ forbid-submodules] ( https://github.com/pre-commit/pre-commit-hooks/blob/main/pre_commit_hooks/forbid_submodules.py )
279
313
280
314
## Custom hooks
281
315
@@ -369,7 +403,7 @@ To run the all the hooks on CI:
369
403
nix flake check
370
404
```
371
405
372
- To install pre-commit hooks developers would run:
406
+ To install pre-commit, hooks developers would run:
373
407
374
408
``` bash
375
409
nix develop
0 commit comments