Skip to content

Commit 43f02e2

Browse files
[STYLE] minor style fixes (- WIP PR #178 -)
### ChangeLog: Changes in file .github/workflows/makefile-lint.yml: jobs: Changes in file .github/workflows/markdown-lint.yml: jobs:
1 parent 16eda38 commit 43f02e2

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

.github/workflows/makefile-lint.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ jobs:
2424
run: |
2525
sudo apt-get update || exit 1
2626
sudo apt-get install -y yamllint golang-go pandoc || exit 1
27-
go version || { printf "::error file=.github/workflow/makefile-lint.yml,line=25,endLine=27,title=FAILURE::ERROR %s\n" "Go installation failed."; exit 1; }
27+
ERR_MSG_STUB="Go installation failed."
28+
ERR_DETAILS="file=.github/workflow/makefile-lint.yml,line=25,endLine=30,title=FAILURE"
29+
ERR_MSG_LINE="::error ${ERR_DETAILS}::ERROR ${ERR_MSG_STUB}"
30+
go version || { printf "%s\n" "${ERR_MSG_LINE}"; exit 1; }
2831
- name: Lint Workflow YAML
2932
if: ${{ success() }}
3033
run: |
@@ -41,9 +44,19 @@ jobs:
4144
EXPECTED_SHA="48ab7819837d1bdfcbac58e301478a06efebf4a8" # v0.2.2
4245
ACTUAL_SHA=$(git rev-parse HEAD)
4346
if [ "$EXPECTED_SHA" != "$ACTUAL_SHA" ]; then
44-
{ printf "::error file=.github/workflow/makefile-lint.yml,line=39,endLine=44,title=FAILURE::ERROR %s\n" "Checkmake repository hash verification failed." ; exit 1; }
47+
ERR_MSG_STUB="Checkmake repository hash verification failed."
48+
ERR_DETAILS="file=.github/workflow/makefile-lint.yml,line=42,endLine=51,title=FAILURE"
49+
ERR_MSG_LINE="::error ${ERR_DETAILS}::ERROR ${ERR_MSG_STUB}"
50+
printf "%s\n" "${ERR_MSG_LINE}"
51+
exit 1;
4552
fi
46-
make || { printf "::error file=.github/workflow/makefile-lint.yml,line=46,endLine=46,title=FAILURE::ERROR %s\n" "Checkmake build failed."; exit 1; }
53+
make || { \
54+
ERR_MSG_STUB="Checkmake build failed." \
55+
ERR_DETS="file=.github/workflow/makefile-lint.yml,line=52,endLine=57,title=FAILURE" \
56+
ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}" \
57+
printf "%s\n" "${ERR_MSG_LINE}" \
58+
exit 1; \
59+
;}
4760
cd ..
4861
- name: Get makefiles Files
4962
id: makefiles
@@ -65,11 +78,19 @@ jobs:
6578
run: |
6679
TOOL_PATH=".github/tool_checkmake.sh"
6780
if [ ! -x "$TOOL_PATH" ]; then
68-
printf "::error file=.github/workflow/makefile-lint.yml,line=66,endLine=70,title=FAILURE::ERROR %s\n" "$TOOL_PATH not found or not executable."
69-
exit 1
81+
{ \
82+
ERR_MSG_STUB="$TOOL_PATH not found or not executable." \
83+
ERR_DETS="file=.github/workflow/makefile-lint.yml,line=79,endLine=88,title=FAILURE" \
84+
ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}" \
85+
printf "%s\n" "${ERR_MSG_LINE}" \
86+
exit 1; \
87+
;}
7088
fi
7189
FILE="${{ steps.makefiles.outputs.files }}" ;
7290
printf "::group::%s\n" "${FILE}" ;
73-
"$TOOL_PATH" "${FILE}" || { printf "::error file=.github/workflow/makefile-lint.yml,line=73,endLine=73,title=FAILURE::ERROR %s\n" "Linting failed."; exit 1; } ;
91+
ERR_MSG_STUB="Linting failed."
92+
ERR_DETS="file=.github/workflow/makefile-lint.yml,line=89,endLine=97,title=FAILURE"
93+
ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}"
94+
"$TOOL_PATH" "${FILE}" || { printf "%s\n" "${ERR_MSG_LINE}"; exit 1; } ;
7495
printf "::endgroup::\n" ; unset FILE 2>/dev/null || true ;
7596
if: ${{ !cancelled() && steps.makefiles.outputs.files != '' }}

.github/workflows/markdown-lint.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ jobs:
2525
run: |
2626
sudo apt-get update
2727
sudo apt-get install -y yamllint npm
28-
yamllint --version || { printf "::error file=.github/workflow/markdown-lint.yml,line=26,endLine=28,title=FAILURE::ERROR %s\n" "yamllint installation failed."; exit 1; }
28+
ERR_MSG_STUB="yamllint installation failed."
29+
ERR_DETAILS="file=.github/workflow/markdown-lint.yml,line=26,endLine=31,title=FAILURE"
30+
ERR_MSG_LINE="::error ${ERR_DETAILS}::ERROR ${ERR_MSG_STUB}"
31+
yamllint --version || { printf "%s\n" "${ERR_MSG_LINE}"; exit 1; }
2932
3033
- name: Lint Workflow YAML
3134
run: |

0 commit comments

Comments
 (0)