Skip to content

Commit c478fb3

Browse files
committed
fx script 3.0
fx script 2.0 fx script?
1 parent 562099c commit c478fb3

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

integration-tests/init-without-token/expected/tools-configs/ruleset.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
66
<description>Codacy PMD Ruleset</description>
7-
87
<rule ref="category/apex/design.xml/AvoidDeeplyNestedIfStmts"/>
98
<rule ref="category/apex/design.xml/ExcessiveClassLength"/>
109
<rule ref="category/apex/design.xml/ExcessiveParameterList"/>

integration-tests/run.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ normalize_config() {
2323
# For YAML files, use yq to sort
2424
yq e '.' "$file" | sort
2525
;;
26-
rc|conf|ini|xml)
26+
rc|conf|ini)
2727
# For other config files, sort values after '=' and keep other lines
2828
awk -F'=' '
2929
/^[^#].*=.*,/ {
@@ -49,6 +49,21 @@ normalize_config() {
4949
{ print }
5050
' "$file" | sort
5151
;;
52+
xml)
53+
# For XML files, ignore order of <rule ref=.../> lines for comparison
54+
awk '
55+
BEGIN { n = 0; end = ""; }
56+
/^ *<rule ref=/ { rules[++n] = $0; next }
57+
/^ *<\/ruleset>/ { end = $0; next }
58+
{ print }
59+
END {
60+
# Sort and print rules
61+
n = asort(rules, sorted_rules)
62+
for (i = 1; i <= n; i++) print sorted_rules[i]
63+
if (end) print end
64+
}
65+
' "$file"
66+
;;
5267
*)
5368
# For other files, just sort
5469
sort "$file"

0 commit comments

Comments
 (0)