Skip to content

Commit 502ab2c

Browse files
authored
Update pmd.yml
1 parent d4b77fb commit 502ab2c

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

.github/workflows/pmd.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,26 @@ 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 '
59-
:a
60-
/&$/ {
61-
N
62-
s/&[[:space:]]*\n[[:space:]]*&/ /
63-
ba
64-
}
65-
s/&//g
66-
' "$file" | \
6758
sed -E \
6859
-e '/^\s*!/s/.*//' \
6960
-e '/^[cC*dD]/s/.*//' \
7061
-e '/^[ \t]*[cC*dD]/s/.*//' \
7162
-e 's/([^"'\'']*("[^"]*"[^"'\'']*|'\''[^'\'']*'\''[^"'\'']*)*[^"'\'']*)[!].*$/\1/' \
72-
> "$TMP_FILE"
73-
63+
"$file" | \
64+
sed -E '
65+
:a
66+
/\s*(\S+)\s*\n\s*([+*/=()-])/ {
67+
N
68+
s/([+*/=()-])\s*\n\s*([+*/=()-])/\1\2/
69+
s/\s*\n\s*/ /
70+
ba
71+
}
72+
/\s*\n\s*\+/ {
73+
N
74+
s/\s*\n\s*\+/ +/
75+
ba
76+
}
77+
' > "$TMP_FILE"
7478
# Check if file was actually modified before replacing
7579
if cmp -s "$file" "$TMP_FILE"; then
7680
echo -e "No changes needed for $file"

0 commit comments

Comments
 (0)