style 💎: Remove unnecessary blank line and ensure consistent formatting #25

Merged
Jose merged 4 commits from dev into main 2026-02-14 12:09:29 +01:00
3 changed files with 33 additions and 3 deletions

View File

@@ -2,7 +2,10 @@
# .gitea/workflows/ansible-lint.yml
name: ansible-lint
on: [issues, push]
on:
push:
Review

[Lines 5-6] [Score: 3] Unnecessary empty line between trigger events. Consider removing it for consistency and readability.

[Lines 5-6] [Score: 3] Unnecessary empty line between trigger events. Consider removing it for consistency and readability.
issues:
types: [opened]
jobs:
build:

View File

@@ -2,7 +2,10 @@
# .gitea/workflows/markdown-lint.yml
name: Markdown Lint
Review

[Lines 2-3] [Score: 2] Workflow is now triggered for both push events and opened issues, which could impact performance if the workflows are resource-intensive. Consider limiting the workflow runs to reduce potential overhead.

[Lines 2-3] [Score: 2] Workflow is now triggered for both push events and opened issues, which could impact performance if the workflows are resource-intensive. Consider limiting the workflow runs to reduce potential overhead.
on: [issues, push]
on:
push:
issues:
types: [opened]
jobs:
build:

View File

@@ -104,6 +104,14 @@ jobs:
"$API/issues/$PR/comments"
fi
# Remove ci-pass +label if exists
LABELS=$(curl -s -H "Authorization: token $TOKEN" "$API/issues/$PR/labels" | jq -r '.[] | .name')
if echo "$LABELS" | grep -q "^ci-pass$"; then
curl -s -X DELETE \
-H "Authorization: token $TOKEN" \
"$API/issues/$PR/labels/ci-pass"
fi
# Add label if missing
LABELS=$(curl -s -H "Authorization: token $TOKEN" "$API/issues/$PR/labels" | jq -r '.[] | .name')
if ! echo "$LABELS" | grep -q "^ci-failed$"; then
Review

[Lines 107-117] [Score: 2] The code has been modified to remove the 'ci-pass' label if it exists and add it back if it doesn't. This might lead to inconsistency in label usage, as removing the label could happen before it is added back in certain scenarios.

[Lines 107-117] [Score: 2] The code has been modified to remove the 'ci-pass' label if it exists and add it back if it doesn't. This might lead to inconsistency in label usage, as removing the label could happen before it is added back in certain scenarios.
@@ -147,9 +155,15 @@ jobs:
-H "Content-Type: application/json" \
-d "{\"body\":\"<!--ci-failed-comment-->\n$COMMENT_BODY\"}" \
"$API/issues/$PR/comments/$EXISTING_COMMENT_ID"
else
curl -s -X POST \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "$COMMENT_PAYLOAD" \
"$API/issues/$PR/comments"
fi
# Remove label if exists
# Remove ci-failed +label if exists
LABELS=$(curl -s -H "Authorization: token $TOKEN" "$API/issues/$PR/labels" | jq -r '.[] | .name')
if echo "$LABELS" | grep -q "^ci-failed$"; then
curl -s -X DELETE \
@@ -157,6 +171,16 @@ jobs:
"$API/issues/$PR/labels/ci-failed"
fi
# Add ci-pass if not present
if ! echo "$LABELS" | grep -q "^ci-pass$"; then
echo "Adding ci-pass label"
Review

[Lines 155-176] [Score: 2] The code has been modified to remove the 'ci-failed' label if it exists and add the 'ci-pass' label if it doesn't. While this is a good practice to ensure that at least one of these labels is always present, it might lead to inconsistency in label usage, as removing the 'ci-failed' label could happen before it is added back in certain scenarios.

[Lines 155-176] [Score: 2] The code has been modified to remove the 'ci-failed' label if it exists and add the 'ci-pass' label if it doesn't. While this is a good practice to ensure that at least one of these labels is always present, it might lead to inconsistency in label usage, as removing the 'ci-failed' label could happen before it is added back in certain scenarios.
curl -s -X POST \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d '{"labels":["ci-pass"]}' \
"$API/issues/$PR/labels"
fi
# Reopen PR if closed
PR_STATE=$(curl -s -H "Authorization: token $TOKEN" "$API/pulls/$PR" | jq -r '.state')
if [ "$PR_STATE" = "closed" ]; then
Review

[Lines 184-186] [Score: 2] The code reopens the pull request if it is closed. This might lead to unnecessary confusion and potential merge conflicts if the pull request was closed appropriately. It's generally better to have explicit human intervention before reopening closed pull requests.

[Lines 184-186] [Score: 2] The code reopens the pull request if it is closed. This might lead to unnecessary confusion and potential merge conflicts if the pull request was closed appropriately. It's generally better to have explicit human intervention before reopening closed pull requests.