File tree 2 files changed +43
-0
lines changed
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ extends: relaxed
3
+ rules:
4
+ indentation: { spaces: 2, indent-sequences: false }
5
+ line-length: disable
6
+ colons:
7
+ max-spaces-before: 0
8
+ max-spaces-after: 1
9
+ empty-lines: disable
10
+ trailing-spaces: enable
11
+ new-line-at-end-of-file: enable
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Use yamllint to lint and report errors for modified topic_map.yml files
4
+
5
+ # Ensure yamllint is installed
6
+ if ! command -v yamllint & > /dev/null; then
7
+ echo " yamllint is not installed. Please install it and try again 👻"
8
+ exit 127
9
+ fi
10
+
11
+ # List of modified topic_map files
12
+ FILES=$( git diff --name-only HEAD~1 HEAD --diff-filter=d " ./_topic_maps/*.yml" )
13
+
14
+ if [ -n " ${FILES} " ]; then
15
+ has_errors=0
16
+ for FILE in ${FILES[@]} ; do
17
+ if ! yamllint " $FILE " ; then
18
+ echo " YAML error(s) found in $FILE 😥"
19
+ has_errors=1
20
+ fi
21
+ done
22
+
23
+ if [ $has_errors -eq 1 ]; then
24
+ exit 1
25
+ else
26
+ echo " No YAML errors found 🥳"
27
+ exit 0
28
+ fi
29
+ else
30
+ echo " No updated topic_maps... 😙"
31
+ exit 0
32
+ fi
You can’t perform that action at this time.
0 commit comments