diff options
| author | Matthew Fennell <matthew@fennell.dev> | 2026-09-09 20:10:25 +0100 |
|---|---|---|
| committer | Matthew Fennell <matthew@fennell.dev> | 2026-09-09 21:17:28 +0100 |
| commit | fcbf8dfb52bc249450af28a111829d1fc59eac1f (patch) | |
| tree | ded58c8f696bad71c8f6ff98599c1d1c1086bc9f | |
| parent | 83e062e243e110d4a8198ec30b3bba3b2d65589d (diff) | |
Copy linters and hooks from xmpp-server playbook
These are used to stop the repository from descending into chaos and to raise
issues that I might have missed.
| -rw-r--r-- | .precious.toml | 49 | ||||
| -rw-r--r-- | Makefile | 9 | ||||
| -rwxr-xr-x | hooks/pre-commit | 6 |
3 files changed, 64 insertions, 0 deletions
diff --git a/.precious.toml b/.precious.toml new file mode 100644 index 0000000..2fc011b --- /dev/null +++ b/.precious.toml @@ -0,0 +1,49 @@ +# SPDX-FileCopyrightText: 2024 Matthew Fennell <matthew@fennell.dev> +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +[commands.ansiblelint] +cmd = ["ansible-lint", "-q"] +include = "*" +invoke = "once" +ok_exit_codes = [0] +path_args = "none" +type = "lint" + +[commands.black] +cmd = ["black", "--quiet", "--check"] +include = ["*.py"] +invoke = "once" +ok_exit_codes = 0 +type = "lint" + +[commands.gitlint] +cmd = ["gitlint"] +include = "*" +invoke = "once" +ok_exit_codes = [0] +path_args = "none" +type = "lint" + +[commands.reuse] +cmd = ["reuse", "lint"] +include = "*" +invoke = "once" +lint_failure_exit_codes = [1] +ok_exit_codes = [0] +path_args = "none" +type = "lint" + +[commands.shellcheck] +cmd = ["shellcheck", "--severity=style", "--enable=all"] +include = ["hooks/*"] +lint_failure_exit_codes = [1] +ok_exit_codes = [0] +type = "lint" + +[commands.yamllint] +cmd = ["yamllint", "--strict"] +include = ["*.yml*"] +lint_failure_exit_codes = [1, 2] +ok_exit_codes = [0] +type = "lint" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b5c97a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +#!/usr/bin/make -f +# SPDX-FileCopyrightText: 2024 Matthew Fennell <matthew@fennell.dev> +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +.PHONY: lint + +lint: + precious --ascii lint --all diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..326159d --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,6 @@ +#!/bin/sh +# SPDX-FileCopyrightText: 2024 Matthew Fennell <matthew@fennell.dev> +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +make lint |
