Skip to content

Commit b56b73b

Browse files
[STYLE] Minor fixes and tweaks (- WIP PR #227 -)
Changes in file .github/workflows/makefile-lint.yml: - fixed line numebrs in diognostics Changes in file .github/workflows/markdown-lint.yml: - fixed a typo - fixed line numbers in diognostics
1 parent 01e224d commit b56b73b

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

.github/workflows/makefile-lint.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ jobs:
5656
YAML_ARGS="${{ vars.YAML_ARGS }}"
5757
if [[ "${YAML_ARGS}" =~ ^*[!a-zA-Z0-9\ \-\.]*$ ]]; then
5858
ERR_MSG_STUB="Invalid YAML_ARGS: contains unauthorized characters!"
59-
ERR_LOC="file=.github/workflows/markdown-lint.yml,line=37,endLine=42,"
59+
ERR_LOC="file=.github/workflows/makefile-lint.yml,line=56,endLine=57,"
6060
printf "::error %s%s\n" "${ERR_LOC}" "title=VALIDATION_ERROR::ERROR ${ERR_MSG_STUB}"
6161
exit 1
6262
else
63-
printf "::notice file=.github/workflows/markdown-lint.yml,%s %s\n" \
64-
"line=36,endLine=47,title=Validation::Validating workflow with args:" \
63+
printf "::notice file=.github/workflows/makefile-lint.yml,%s %s\n" \
64+
"line=67,endLine=67,title=Validation::Validating workflow with args:" \
6565
"${YAML_ARGS}"
6666
read -ra ARGS <<< "${YAML_ARGS}"
67-
yamllint "${ARGS[@]}" .github/workflows/markdown-lint.yml
67+
yamllint "${ARGS[@]}" .github/workflows/makefile-lint.yml
6868
fi
6969
- name: Install checkmake
7070
if: ${{ success() }}
@@ -78,14 +78,14 @@ jobs:
7878
ACTUAL_SHA=$(git rev-parse HEAD)
7979
if [ "$EXPECTED_SHA" != "$ACTUAL_SHA" ]; then
8080
ERR_MSG_STUB="Checkmake repository hash verification failed."
81-
ERR_DETAILS="file=.github/workflows/makefile-lint.yml,line=42,endLine=51,title=FAILURE"
81+
ERR_DETAILS="file=.github/workflows/makefile-lint.yml,line=75,endLine=79,title=FAILURE"
8282
ERR_MSG_LINE="::error ${ERR_DETAILS}::ERROR ${ERR_MSG_STUB}"
8383
printf "%s\n" "${ERR_MSG_LINE}"
8484
exit 1;
8585
fi
8686
make && make install || { \
8787
ERR_MSG_STUB="Checkmake build failed." \
88-
ERR_DETS="file=.github/workflows/makefile-lint.yml,line=52,endLine=59,title=FAILURE" \
88+
ERR_DETS="file=.github/workflows/makefile-lint.yml,line=86,endLine=92,title=FAILURE" \
8989
ERR_MSG_LINE="::error ${ERR_DETS}::ERROR ${ERR_MSG_STUB}" \
9090
printf "%s\n" "${ERR_MSG_LINE}" \
9191
exit 1 \
@@ -120,10 +120,10 @@ jobs:
120120
"${file_stub}" "${line_start}" "${line_end}" "${msg}"
121121
}
122122
if [ ! -x "$TOOL_PATH" ]; then
123-
{ print_error "$TOOL_PATH not found or not executable." 101 103; exit 1; } ;
123+
{ print_error "$TOOL_PATH not found or not executable." 122 124; exit 1; } ;
124124
fi
125125
FILE="${{ steps.makefiles.outputs.files }}" ;
126126
printf "::group::%s\n" "${FILE}" ;
127-
"$TOOL_PATH" "${FILE}" || { print_error "Linting failed." 106 106; exit 1; } ;
127+
"$TOOL_PATH" "${FILE}" || { print_error "Linting failed." 127 127; exit 1; } ;
128128
printf "::endgroup::\n" ; unset FILE 2>/dev/null || true ;
129129
if: ${{ !cancelled() && steps.makefiles.outputs.files != '' }}

.github/workflows/markdown-lint.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,30 @@ jobs:
4242
YAML_ARGS="${{ vars.YAML_ARGS }}"
4343
if [[ "${YAML_ARGS}" =~ ^*[!a-zA-Z0-9\ \-\.]*$ ]]; then
4444
ERR_MSG_STUB="Invalid YAML_ARGS: contains unauthorized characters!"
45-
ERR_LOC="file=.github/workflows/markdown-lint.yml,line=37,endLine=42,"
45+
ERR_LOC="file=.github/workflows/markdown-lint.yml,line=42,endLine=43,"
4646
printf "::error %s%s\n" "${ERR_LOC}" "title=VALIDATION_ERROR::ERROR ${ERR_MSG_STUB}"
4747
exit 1
4848
else
4949
printf "::notice file=.github/workflows/markdown-lint.yml,%s %s\n" \
50-
"line=42,endLine=43,title=Validation::Validating workflow with args:" \
50+
"line=53,endLine=53,title=Validation::Validating workflow with args:" \
5151
"${YAML_ARGS}"
5252
read -ra ARGS <<< "${YAML_ARGS}"
5353
yamllint "${ARGS[@]}" .github/workflows/markdown-lint.yml
5454
fi
5555
56+
- name: Lint YAML config for markdown
57+
if: ${{ success() }}
58+
run: |
59+
YAML_ARGS="${{ vars.YAML_ARGS }}"
60+
read -ra ARGS <<< "${YAML_ARGS}"
61+
yamllint "${ARGS[@]}" .markdownlint.yaml
62+
5663
- name: Install NPM Dependencies
64+
if: ${{ success() }}
5765
run: |
5866
# npm install
5967
ERR_MSG="NPM package installation failed"
60-
ERR_LOC_1="file=.github/workflows/markdown-lint.yml,line=62,endLine=62"
68+
ERR_LOC_1="file=.github/workflows/markdown-lint.yml,line=70,endLine=70"
6169
ERR_LOC_2="file=package.json,line=2,endLine=4"
6270
if ! NPM_ERROR=$(npm install 2>&1); then
6371
for LOC in "${ERR_LOC_1}" "${ERR_LOC_2}"; do
@@ -66,14 +74,8 @@ jobs:
6674
done
6775
fi
6876
69-
- name: Lint YAML config for markdown
70-
run: |
71-
YAML_ARGS="${{ vars.YAML_ARGS }}"
72-
read -ra ARGS <<< "${YAML_ARGS}"
73-
yamllint ${{ vars.YAML_ARGS }} .markdownlint.yaml
74-
7577
- name: Lint Markdown Files with YAML config
76-
if: ${{ !cancelled() }}
78+
if: ${{ success() }}
7779
run: |
7880
git ls-files --exclude-standard -z -- *.md **/*.md |\
7981
xargs -0 -I{} npm run lint:md -- "{}";

0 commit comments

Comments
 (0)