From 8eb19c67e81301c1e148a0ada96ae6729cb9f93c Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 21 Apr 2026 17:25:46 +0200 Subject: [PATCH] feat: add linter and ci configs --- .ansible-lint | 23 +++++++++++++++++++++++ .gitlab-ci.yml | 13 +++++++++++++ .markdownlint-cli2.jsonc | 12 ++++++++++++ .yamllint | 30 ++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 .ansible-lint create mode 100644 .gitlab-ci.yml create mode 100644 .markdownlint-cli2.jsonc create mode 100644 .yamllint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..9b9b52a --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,23 @@ +--- + +exclude_paths: + - ".gitlab/*" + - ".gitlab-ci.yml" + - "defaults/main.yaml" + - "meta/main.yaml" + - "vars/*" + +kinds: + - playbook: "**/*.{yml,yaml}" + +skip_list: + - "command-shell" + - "experimental" + - "git-latest" + - "no-changed-when" + - "no-handler" + - "name[casing]" + - "name[template]" + - "risky-file-permissions" + - "schema[playbook]" + - "var-naming[no-role-prefix]" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..7ec2c37 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,13 @@ +--- + +# gitlab stages +stages: + - "gitleaks" + - "linting" + +# include components +include: + - component: "$CI_SERVER_FQDN/components/ansible/linting@v3.0.3" + - component: "$CI_SERVER_FQDN/components/gitleaks/gitleaks@v1.0.0" + - component: "$CI_SERVER_FQDN/components/markdownlint/markdownlint@1.0.0" + - component: "$CI_SERVER_FQDN/components/yamllint/yamllint@1.0.2" diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc new file mode 100644 index 0000000..56cd87c --- /dev/null +++ b/.markdownlint-cli2.jsonc @@ -0,0 +1,12 @@ +{ + // files to lint + "globs": [ + "readme.md" + ], + // linting rules + "config": { + "MD013": { + "line_length": 120 + } + } +} diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..f11bd84 --- /dev/null +++ b/.yamllint @@ -0,0 +1,30 @@ +--- +extends: 'default' + +rules: + braces: + max-spaces-inside: 1 + forbid: true + comments: + min-spaces-from-content: 1 + comments-indentation: false + empty-lines: + max: 2 + indentation: + spaces: 2 + check-multi-line-strings: true + line-length: + max: 120 + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + new-line-at-end-of-file: 'enable' + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + truthy: + allowed-values: + - 'true' + - 'false' + quoted-strings: + quote-type: 'any' + required: true