From 1085275c7694795470c5e6717fad06de0fd8ee57 Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Tue, 2 Dec 2025 04:58:46 +0100 Subject: [PATCH] chore: Added pre-commit hooks --- .pre-commit-config.yaml | 28 ++++++++++++++++++++++++++++ .typos.toml | 6 ++++++ bootstrap.sh | 2 ++ committed.toml | 2 ++ 4 files changed, 38 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 .typos.toml create mode 100644 committed.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..7fbd232 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +default_install_hook_types: [pre-commit, commit-msg] +exclude: gotk-.*.yaml +repos: + - repo: builtin + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + args: + - --allow-multiple-documents + - id: check-added-large-files + - id: check-merge-conflict + - id: check-executables-have-shebangs + + - repo: https://github.com/crate-ci/typos + rev: v1.40.0 + hooks: + - id: typos + + - repo: https://github.com/sirwart/ripsecrets + rev: v0.1.11 + hooks: + - id: ripsecrets-system + + - repo: https://github.com/crate-ci/committed + rev: v1.1.8 + hooks: + - id: committed diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..8848db7 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,6 @@ +[default] +extend-ignore-re = [ + "(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", + "(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", + "(#|//)\\s*spellchecker:ignore-next-line\\n.*", +] diff --git a/bootstrap.sh b/bootstrap.sh index 1f20a75..8888375 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -58,6 +58,7 @@ if [ "${vip}" = "null" ]; then fi echo -n "Checking connection to ${bootstrap_ip}... " +# spellchecker:ignore-next-line if nmap -Pn ${bootstrap_ip} -p 50000 | grep -q 'open'; then echo "[Success]" else @@ -67,6 +68,7 @@ fi count=0 max_retries=20 +# spellchecker:ignore-next-line while ! nmap -Pn ${vip} -p 50000 | grep -q 'open' && [ ${count} -lt ${max_retries} ]; do if [ $count -eq 0 ]; then echo -n "Bootstrapping Kubernetes" diff --git a/committed.toml b/committed.toml new file mode 100644 index 0000000..02407f5 --- /dev/null +++ b/committed.toml @@ -0,0 +1,2 @@ +style = "conventional" +ignore_author_re = "Flux"