Skip to content

Commit 2d09eec

Browse files
committed
Remove useless trailing commas in Perl scripts
We no longer need the CodeLayout::RequireTrailingCommaAtNewline perlcritic policy.
1 parent f2cdd7b commit 2d09eec

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

.perlcriticrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ allow = lock
205205
# innreport.
206206
[-CodeLayout::RequireFinalSemicolon]
207207

208+
# perltidy takes care of the preferred formatting with regards to trailing
209+
# commas. Its -dwic flag omits the comma if there is a single argument so that
210+
# the call will be collapsed to a single line if it will fit whereas this
211+
# policy always wants it.
212+
[-CodeLayout::RequireTrailingCommaAtNewline]
213+
208214
# Getopt::Std is still used and fits our needs.
209215
[-Community::PreferredAlternatives]
210216

.perltidyrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
-wtc=m # add trailing commas to all multi-line lists
2929
-atc # add trailing commas where needed
3030
-dtc # delete trailing commas where needed
31+
-altc # add trailing comma to long arguments (perlcritic needs this)
32+
-dwic # delete commas that interfere with welding
3133
-dia # delete interbracket arrows
3234
-viu # align trailing unless with if
3335

control/perl-nocem.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Documentation improved by Jeffrey M. Vinocur (2002), Russ Allbery (2006)
1515
# and Julien Élie (2007).
1616
# Various bug fixes, code and documentation improvements by Julien Élie
17-
# in 2007-2009, 2013, 2014, 2016, 2018, 2020-2024.
17+
# in 2007-2009, 2013, 2014, 2016, 2018, 2020-2025.
1818
##############################################################################
1919

2020
require 5.00403;
@@ -248,7 +248,7 @@ sub do_nocem {
248248
. "(%d ids, %d skipped, %.5f s, %.1f/s)",
249249
$msgid, $nid, $issuer, $type, $nr, $skipped, $diff,
250250
($nr + $skipped) / $diff,
251-
),
251+
)
252252
);
253253
}
254254

@@ -350,7 +350,7 @@ sub read_nocem {
350350
"Article %s: %s notice %s by %s for %s (%d ids)",
351351
$msgid, $opt_u ? "skipped" : "unwanted", $hdrs{'notice-id'},
352352
$hdrs{issuer}, $hdrs{type}, $skipped,
353-
),
353+
)
354354
);
355355
return;
356356
}

perl/INN/ovsqlite_client.pm

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,12 @@ BEGIN {
400400
{
401401
name => "cutofflow",
402402
default => 0,
403-
},
403+
}
404404
],
405405
[
406406
{
407407
name => "errmsg",
408-
},
408+
}
409409
],
410410
);
411411

@@ -453,7 +453,7 @@ BEGIN {
453453
[
454454
{
455455
name => "errmsg",
456-
},
456+
}
457457
],
458458
);
459459

@@ -490,7 +490,7 @@ BEGIN {
490490
{
491491
name => "groupname",
492492
required => 1,
493-
},
493+
}
494494
],
495495
[
496496
{
@@ -544,12 +544,12 @@ BEGIN {
544544
{
545545
name => "groupname",
546546
required => 1,
547-
},
547+
}
548548
],
549549
[
550550
{
551551
name => "errmsg",
552-
},
552+
}
553553
],
554554
);
555555

@@ -659,7 +659,7 @@ BEGIN {
659659
[
660660
{
661661
name => "errmsg",
662-
},
662+
}
663663
],
664664
);
665665

@@ -733,7 +733,7 @@ BEGIN {
733733
[
734734
{
735735
name => "errmsg",
736-
},
736+
}
737737
],
738738
);
739739

@@ -831,7 +831,7 @@ BEGIN {
831831
[
832832
{
833833
name => "errmsg",
834-
},
834+
}
835835
],
836836
);
837837

@@ -1004,7 +1004,7 @@ BEGIN {
10041004
[
10051005
{
10061006
name => "errmsg",
1007-
},
1007+
}
10081008
],
10091009
);
10101010

@@ -1055,12 +1055,12 @@ BEGIN {
10551055
{
10561056
name => "groupname",
10571057
required => 1,
1058-
},
1058+
}
10591059
],
10601060
[
10611061
{
10621062
name => "errmsg",
1063-
},
1063+
}
10641064
],
10651065
);
10661066

@@ -1103,7 +1103,7 @@ BEGIN {
11031103
[
11041104
{
11051105
name => "errmsg",
1106-
},
1106+
}
11071107
],
11081108
);
11091109

@@ -1141,7 +1141,7 @@ BEGIN {
11411141
[
11421142
{
11431143
name => "errmsg",
1144-
},
1144+
}
11451145
],
11461146
);
11471147

@@ -1168,12 +1168,12 @@ BEGIN {
11681168
{
11691169
name => "callback",
11701170
required => 1,
1171-
},
1171+
}
11721172
],
11731173
[
11741174
{
11751175
name => "errmsg",
1176-
},
1176+
}
11771177
],
11781178
);
11791179

scripts/inncheck.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ sub incoming_conf {
533533
},
534534
'group' => {},
535535
'peer' => {},
536-
},
536+
}
537537
);
538538
return;
539539
}
@@ -659,7 +659,7 @@ sub innfeed_conf {
659659
'<include>' => {
660660
'$INCLUDE' => 'ignore',
661661
},
662-
},
662+
}
663663
);
664664
# check some numeric values
665665
foreach my $group (keys %groups) {
@@ -1043,7 +1043,7 @@ sub readers_conf {
10431043
'<include>' => {
10441044
'include' => 'ignore',
10451045
},
1046-
},
1046+
}
10471047
);
10481048
return;
10491049
}
@@ -1063,8 +1063,8 @@ sub storage_conf {
10631063
'exactmatch' => 'boolean',
10641064
'filtered' => 'boolean',
10651065
'path' => 'string', # uwildmat_poison
1066-
},
1067-
},
1066+
}
1067+
}
10681068
);
10691069
# allowed method names include: cnfs timecaf timehash tradspool trash
10701070
foreach my $method (keys %groups) {

0 commit comments

Comments
 (0)