File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
init-without-token/expected/tools-configs Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff 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 "
You can’t perform that action at this time.
0 commit comments