From ec3ffa591cdd3393bc0e8f7c439e1be1dd4857a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 18 Dec 2022 16:53:06 +0200 Subject: [PATCH] feat: Add Docker pre-commit hook Mostly as an alternative to the src install, but trading host dependency on Rust with one on Docker. --- .pre-commit-hooks.yaml | 9 +++++++++ docs/pre-commit.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index c145db7..e4fca39 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -7,6 +7,15 @@ types: [text] stages: [commit, merge-commit, push, manual] +- id: typos-docker + name: typos + description: Source code spell checker, Docker image + language: docker + entry: typos + args: [--write-changes] + types: [text] + stages: [commit, merge-commit, push, manual] + - id: typos-src name: typos description: Source code spell checker, source install diff --git a/docs/pre-commit.md b/docs/pre-commit.md index 7b01702..43b847c 100644 --- a/docs/pre-commit.md +++ b/docs/pre-commit.md @@ -13,7 +13,8 @@ repos: The `typos` id installs a prebuilt executable from GitHub releases. If one does not exist for the target platform, or if one built from -sources is preferred, use `typos-src` as the hook id instead. +sources is preferred, use `typos-docker` (requires Docker), or `typos-src` +(requires Rust) as the hook id instead. Be sure to change `rev` to use the desired `typos` git tag or revision.