aboutsummaryrefslogtreecommitdiffstats
path: root/.yamllint
diff options
context:
space:
mode:
authorColin Wilk <colin.wilk@tum.de>2023-05-22 23:32:53 +0200
committerColin Wilk <colin.wilk@tum.de>2023-05-24 19:41:18 +0200
commitb892f1d7262b36e2ba895768272779571c613adf (patch)
treeb103e77db04305465cab1331ecddada726893d25 /.yamllint
parent1f1f6eeaebc148602085515350eb12829f86c315 (diff)
downloadansible-role-borgbackup-b892f1d7262b36e2ba895768272779571c613adf.tar.gz
ansible-role-borgbackup-b892f1d7262b36e2ba895768272779571c613adf.zip
Add YAMLLint rules
Fix linting errors that came up with the new rules Main changes: * Enforce YAML document start headers * Enforce spacing with commas, colons and hyphens * Enforce indentation * Enforce use of quotes only then required * Enforce use of single quotes over double quotes * Enforce use of true/false over yes/no and derivatives * [..] Other minor rules that were already followed Signed-off-by: Colin Wilk <colin.wilk@tum.de>
Diffstat (limited to '.yamllint')
-rw-r--r--.yamllint52
1 files changed, 52 insertions, 0 deletions
diff --git a/.yamllint b/.yamllint
new file mode 100644
index 0000000..8551271
--- /dev/null
+++ b/.yamllint
@@ -0,0 +1,52 @@
+# https://yamllint.readthedocs.io/en/stable/rules.html
+---
+rules:
+ quoted-strings:
+ quote-type: single
+ required: only-when-needed
+
+ colons:
+ max-spaces-before: 0
+ max-spaces-after: 1
+
+ commas:
+ max-spaces-before: 0
+ min-spaces-after: 1
+ max-spaces-after: 1
+
+ comments:
+ require-starting-space: true
+ ignore-shebangs: true
+ min-spaces-from-content: 1
+
+ document-end:
+ present: false
+
+ document-start:
+ present: true
+
+ empty-lines:
+ max: 2
+ max-start: 0
+ max-end: 0
+
+ empty-values:
+ forbid-in-block-mappings: true
+ forbid-in-flow-mappings: true
+
+ float-values:
+ require-numeral-before-decimal: true
+
+ hyphens:
+ max-spaces-after: 1
+
+ indentation:
+ spaces: 2
+ indent-sequences: true
+ check-multi-line-strings: true
+
+ trailing-spaces: {}
+
+ truthy:
+ allowed-values: ['true', 'false']
+ check-keys: true