SonarQube Cloud's php:S103 flagged 344 lines over 120 characters. They
are wrapped in the existing style: tabs, braces on the same line, one
argument or array element per line, SQL broken at whitespace, and long
literals joined with the same resulting text. A token comparison
against main, folding joined literals, matches for every file but two
interpolated strings, which keep their text.
Seven lines stay long: each is a translated string alone on its line,
and splitting it would change its translation key.
The placeholder rule in SourceRulesTest now allows a line break after
__(, which the wrapping introduced; without it the rule silently
skipped those strings. The translation template is regenerated: the
same strings, in the order the wrapped sources now give.
Refs #38
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Fixes the SonarQube Cloud findings on main that don't conflict with the Cacti code style: 352 of the 913.
php:S103, 337 of 344: lines over 120 characters are wrapped in the existing style. That means tabs, braces on the same line, one argument or array element per line, and SQL broken at whitespace. A long literal is joined back with.so the text is unchanged. A token comparison against main, folding joined literals, matches every file except two strings containing variables, whose text I checked by hand. Seven lines stay long, because each is a translated string alone on its line, and splitting it would change its translation key.shell:S7679, 5:generate()inlocales/build_gettext.shgives its output path a name instead of using$1throughout.php:S122, 3: test fixtures that ran two statements in a one-line closure now put each on its own line.Two follow-ons from the wrapping:
SourceRulesTestnow allows a line break after__(. Without that it silently skipped wrapped strings, checking 98 instead of 112.cacti.potis regenerated. It has the same strings, in the order the wrapped sources now give.Not changed:
php:S100(Cacti callsplugin_cloud_installand the other hook functions by exact name),php:S105(the repo's.editorconfigand Cacti core use tabs),php:S1808(Cacti puts braces on the same line), andphp:S101(AwsSigV4is AWS's name). These need deactivating in the project's quality profile.Tests, run locally on Cacti 1.2.31 and 1.2.x:
Summary by Gitar
.__(inSourceRulesTestso wrapped strings are still checkedcacti.potto match the reordered wrapped sourcesThis will update automatically on new commits.