Browse Source

Yaml linter execution and config improved

Change-Id: I0cf1d4a02d5018134bf783c4c666aeace3c4f4bf
Sergey Lukjanov 2 years ago
parent
commit
7d633af3ab
5 changed files with 31 additions and 12 deletions
  1. 4
    4
      service/rabbitmq.yaml
  2. 0
    7
      tools/run-check-yaml-syntax.sh
  3. 5
    0
      tools/yamllint.sh
  4. 21
    0
      tools/yamllint.yaml
  5. 1
    1
      tox.ini

+ 4
- 4
service/rabbitmq.yaml View File

@@ -9,10 +9,10 @@ service:
9 9
         readiness: "true"
10 10
         liveness: "true"
11 11
       volumes:
12
-      - name: rabbitmq-logs
13
-        path: "/var/log/ccp/rabbitmq"
14
-        type: host
15
-        readOnly: False
12
+        - name: rabbitmq-logs
13
+          path: "/var/log/ccp/rabbitmq"
14
+          type: host
15
+          readOnly: False
16 16
       pre:
17 17
         - name: chown-logs-dir
18 18
           command: "sudo /bin/chown rabbitmq: /var/log/ccp/rabbitmq"

+ 0
- 7
tools/run-check-yaml-syntax.sh View File

@@ -1,7 +0,0 @@
1
-#!/bin/bash
2
-
3
-### Temp yaml syntax checker script.
4
-set -e
5
-for file in $(find . -name '*.yaml'); do
6
-    yamllint -d relaxed $file
7
-done

+ 5
- 0
tools/yamllint.sh View File

@@ -0,0 +1,5 @@
1
+#!/bin/bash
2
+set -ex
3
+
4
+workdir=$(dirname $0)
5
+yamllint -c $workdir/yamllint.yaml $(find . -not -path '*/\.*' -type f -name '*.yaml')

+ 21
- 0
tools/yamllint.yaml View File

@@ -0,0 +1,21 @@
1
+extends: default
2
+
3
+rules:
4
+  braces:
5
+    max-spaces-inside: 1
6
+  comments:
7
+    level: error
8
+  comments-indentation:
9
+    level: warning
10
+  document-end:
11
+    present: no
12
+  document-start:
13
+    level: error
14
+    present: no
15
+  empty-lines:
16
+    max: 1
17
+    max-start: 0
18
+    max-end: 0
19
+  line-length:
20
+    level: warning
21
+    max: 120

+ 1
- 1
tox.ini View File

@@ -6,7 +6,7 @@ skipsdist = True
6 6
 [testenv:linters]
7 7
 deps = yamllint
8 8
 commands =
9
-    {toxinidir}/tools/run-check-yaml-syntax.sh
9
+    {toxinidir}/tools/yamllint.sh
10 10
 
11 11
 [testenv:bashate]
12 12
 deps = bashate>=0.2

Loading…
Cancel
Save