Skip to content

[perf] Port more pre-commit hooks #880

@lmmx

Description

@lmmx

I don't see a checklist tracking issue for the remaining pre-commit hooks, but some like check-toml have been implemented and gone from sub-second to instant, so this would likely contribute a further speedup on many existing pre-commit configs.

It looks like the specific site of the fast path redirection for these hooks is here in src/builtin/pre_commit_hooks/mod.rs

To support this, I would compare the list in the docs against this repo, specifically in this hooks YAML

pre-commit-hooks

  • check-added-large-files
  • check-ast
  • check-byte-order-marker
  • check-builtin-literals
  • check-case-conflict
  • check-docstring-first
  • check-executables-have-shebangs
  • check-illegal-windows-names
  • check-json
  • check-shebang-scripts-are-executable
  • pretty-format-json
  • check-merge-conflict
  • check-symlinks
  • check-toml
  • check-vcs-permalinks
  • check-xml
  • check-yaml
  • debug-statements
  • destroyed-symlinks
  • detect-aws-credentials
  • detect-private-key
  • double-quote-string-fixer
  • end-of-file-fixer
  • file-contents-sorter
  • fix-byte-order-marker
  • fix-encoding-pragma
  • forbid-new-submodules
  • forbid-submodules
  • mixed-line-ending
  • name-tests-test
  • no-commit-to-branch
  • requirements-txt-fixer
  • sort-simple-yaml
  • trailing-whitespace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions