From 528d713e620bdf4b41849db93cb489c4fef9f5c5 Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Sat, 8 Jun 2024 01:35:52 +0200 Subject: [PATCH] feat: add pre-commit hook config (#19) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ville Skyttä --- .pre-commit-hooks.yaml | 8 ++++++++ README.md | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .pre-commit-hooks.yaml diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..5319a75 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -0,0 +1,8 @@ +- id: misspell + name: misspell + description: Correct commonly misspelled English words... quickly + language: golang + entry: misspell + args: + - -w + - -error diff --git a/README.md b/README.md index 514727f..d2c3e75 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,23 @@ Usage of misspell: -w Overwrite file with corrections (default is just to display) ``` +### Pre-commit hook + +To use misspell with [pre-commit](https://pre-commit.com/), add the following to your `.pre-commit-config.yaml`: + + +```yaml +- repo: https://github.com/golangci/misspell + rev: v0.6.0 + hooks: + - id: misspell + # The hook will run on all files by default. + # To limit to some files only, use pre-commit patterns/types + # files: + # exclude: + # types: +``` + ## FAQ * [Automatic Corrections](#correct)