From 4700b5a58a7e27af48121f3d74fda4075f902b45 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 24 Jul 2024 10:29:12 -1000 Subject: [PATCH] Add codespell config, pre-commit definition, and move options from Makefile Signed-off-by: Yaroslav Halchenko --- .codespellrc | 6 ++++++ .pre-commit-config.yaml | 5 +++++ Makefile | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..d701e173c4 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = bin,vendor,.git,go.sum,.cirrus.yml,"*.fish,RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go +check-hidden = true +ignore-regex = \b(Not|assert)In\b +ignore-words-list = ddress,secon,passt,bu,hastable,te,clos,ans,pullrequest,uint,iff,od,seeked,splitted,marge,erro,hist,ether,specif,whit diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 936b0b14d0..ec9b202ece 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,3 +20,8 @@ repos: - id: check-executables-have-shebangs - id: check-merge-conflict - id: check-yaml + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .codespellrc + rev: v2.2.6 + hooks: + - id: codespell diff --git a/Makefile b/Makefile index db73caae6e..217e4cfbc8 100644 --- a/Makefile +++ b/Makefile @@ -307,7 +307,8 @@ test/version/version: version/version.go .PHONY: codespell codespell: - codespell -S bin,vendor,.git,go.sum,.cirrus.yml,"*.fish,RELEASE_NOTES.md,*.xz,*.gz,*.ps1,*.tar,swagger.yaml,*.tgz,bin2img,*ico,*.png,*.1,*.5,copyimg,*.orig,apidoc.go" -L ddress,secon,passt,bu,hastable,te,clos,ans,pullrequest,uint,iff,od,seeked,splitted,marge,erro,hist,ether,specif -w + # Configuration for codespell is in .codespellrc + codespell -w # Code validation target that **DOES NOT** require building podman binaries .PHONY: validate-source