Skip to content

Commit 26f3228

Browse files
authored
Update pmd.yml
1 parent 037c2e6 commit 26f3228

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/pmd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ jobs:
5555
# - Lines starting with 'c', 'C', '*', 'd', 'D' in column 1 (fixed form comments)
5656
# 2. Remove end-of-line comments (anything after '!' that isn't in a string)
5757
# 3. Preserve strings containing '!' characters
58-
sed -E ' :a /[[:space:]]*&[[:space:]]*$/ { N; s/[[:space:]]*&[[:space:]]*\n[[:space:]]*/ /; ba } s/^[[:space:]]*!\$acc[[:space:]]*/!$acc / :b s/[[:space:]]+!\$acc[[:space:]]*/ /g tb ' "$file" > "$file"
58+
TMP_FILE=$(mktemp)
59+
sed -E ' :a /[[:space:]]*&[[:space:]]*$/ { N; s/[[:space:]]*&[[:space:]]*\n[[:space:]]*/ /; ba } s/^[[:space:]]*!\$acc[[:space:]]*/!$acc / :b s/[[:space:]]+!\$acc[[:space:]]*/ /g tb ' "$file" > "$TMP_FILE" && mv "$TMP_FILE" "$file"
5960

6061
sed -E \
6162
-e '/^\s*!/s/.*//' \
6263
-e '/^[cC*dD]/s/.*//' \
6364
-e '/^[ \t]*[cC*dD]/s/.*//' \
6465
-e 's/([^"'\'']*("[^"]*"[^"'\'']*|'\''[^'\'']*'\''[^"'\'']*)*[^"'\'']*)[!].*$/\1/' \
65-
"$file" > "$TMP_FILE"
66-
66+
"$file" > "$TMP_FILE" && mv "$TMP_FILE" "$file"
6767
# Check if file was actually modified before replacing
6868
if cmp -s "$file" "$TMP_FILE"; then
6969
echo -e "No changes needed for $file"

0 commit comments

Comments
 (0)