diff --git a/.meta/ansible-lint.yml b/.meta/ansible-lint.yml new file mode 100644 index 0000000000000000000000000000000000000000..f388c7c526fdc6476184c2c0352bb6031df43e87 --- /dev/null +++ b/.meta/ansible-lint.yml @@ -0,0 +1,7 @@ +--- +quiet: true +strict: true +profile: "production" +skip_list: + - name[casing] + - yaml diff --git a/.meta/ansible-managed-in-templates b/.meta/ansible-managed-in-templates new file mode 100755 index 0000000000000000000000000000000000000000..09027a2b01958724473ef9b9b8950534bbdd899a --- /dev/null +++ b/.meta/ansible-managed-in-templates @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +import sys + + +def main() -> int: + needle = "{{ ansible_managed | comment }}" + rc = 0 + + for arg in sys.argv[1:]: + with open(arg) as f: + if needle in f.read(): + continue + print(f"Did not find '{needle}' in {arg}") + rc = 1 + + return rc + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.meta/codespell-excludes b/.meta/codespell-excludes new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/.meta/codespell-ignores b/.meta/codespell-ignores new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/.meta/markdown-link-check.json b/.meta/markdown-link-check.json new file mode 100644 index 0000000000000000000000000000000000000000..fb20b22df8c88b0c9e63f0ab19d7692044efb271 --- /dev/null +++ b/.meta/markdown-link-check.json @@ -0,0 +1,9 @@ +{ + "ignorePatterns": [], + "replacementPatterns": [ + { + "pattern": "^/", + "replacement": "{{BASEURL}}/" + } + ] +} diff --git a/.meta/yamllint.yaml b/.meta/yamllint.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b7dccbff96f586fa9e98f8a6f1ceb3d67b9ed660 --- /dev/null +++ b/.meta/yamllint.yaml @@ -0,0 +1,5 @@ +rules: + braces: + forbid: non-empty + indentation: + spaces: 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0495614b4843033b1c5d44b4b9d111ff55e58aad --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,79 @@ +--- +default_language_version: + python: python3.10 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v5.0.0" + hooks: + # General + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: detect-private-key + - id: end-of-file-fixer + - id: mixed-line-ending + - id: pretty-format-json + args: [--autofix] + - id: trailing-whitespace + # General + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + - repo: https://github.com/codespell-project/codespell + rev: "v2.4.1" + hooks: + - id: codespell + args: + [ + --ignore-words, + .meta/codespell-ignores, + --exclude-file, + .meta/codespell-excludes, + --ignore-regex, + '\Whttps?://\S*', + ] + - repo: https://github.com/rkm/pre-commit-nocommit + rev: "v1.0.0" + hooks: + - id: nocommit + exclude: | + (?x)^( + .pre-commit-config.yaml + ) + # Markdown + - repo: https://github.com/tcort/markdown-link-check + rev: "v3.13.7" + hooks: + - id: markdown-link-check + args: [--quiet, --config, .meta/markdown-link-check.json] + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.22 + hooks: + - id: mdformat + additional_dependencies: + - mdformat-gfm==0.3.6 + # YAML + - repo: https://github.com/adrienverge/yamllint + rev: "v1.37.0" + hooks: + - id: yamllint + args: [-c, .meta/yamllint.yaml] + # Ansible + - repo: https://github.com/ansible/ansible-lint.git + rev: "v25.4.0" + hooks: + - id: ansible-lint + args: ["--config", ".meta/ansible-lint.yml"] + additional_dependencies: + - ansible-core==2.17.11 + # Local + # - repo: local + # hooks: + # - id: ansible-managed-in-templates + # name: ansible-managed-in-templates + # entry: .meta/ansible-managed-in-templates + # language: system + # files: "^roles/.*/templates/.*$" + # types: [text] diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ff7cd855910a1a14fac2410e27d313a364d18e9..0bad4decd51411d688bc01f61d527986f2ee6de7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,4 +10,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial `epcc.microk8s` role - diff --git a/README.md b/README.md index fb893f3d0d4acfc05dd67963f254cf0ba585e25f..73694c7b72ab65fb4eb4c6f8da7e169ebf8de1bf 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,3 @@ _TODO_ -