# Perltidy Change Log
-## 2024 02 02.05
+## 2024 02 02.06
+
+ - Add option --minimize-continuation-indentation, -mci (see git #137).
+ This flag allows perltidy to remove continuation indentation in some
+ special cases where it is not really unnecessary. For a simple example,
+ the default formatting for the following snippet is:
+
+ # perltidy -nmci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+
+ The second and third lines are one level deep in a container, and
+ are also statement continuations, so they get indented by the sum
+ of the -i value and the -ci value. If this flag is set, the
+ indentation is reduced by -ci spaces, giving
+
+ # perltidy -mci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+
+ This situation is relatively rare except in code which has long
+ quoted strings and the -nolq flag is also set. This flag is currently
+ off by default, but it could become the default in a future version.
- Add options --dump-mismatched-args (or -dma) and
--warn-mismatched-arg (or -wma). These options look
)
)
+=item B<-mci>, B<--minimize-continuation-indentation>
+
+This flag allows perltidy to remove continuation indentation in some
+special cases where it is not really unnecessary. For a simple example,
+the default formatting for the following snippet is:
+
+ # perltidy -nmci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+
+The second and third lines are one level deep in a container, and are also
+statement continuations, so they get indented by the sum of the B<-i>
+value and the B<-ci> value. If this flag is set, the indentation is reduced by
+B<-ci> spaces, giving
+
+ # perltidy -mci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+
+This flag is currently off by default, but it could become the default in a
+future version.
+
=item B<-sil=n> B<--starting-indentation-level=n>
By default, perltidy examines the input file and tries to determine the
hico hih hihh hii hij hik him hin hip hipd
hipu hiq his hisc hiv hiw hsc html ibc icb
icp iob ipc isbc iscl kgb kgbd kgbi kis lal
- log lop lp lsl mem nib ohbr okw ola olc
- oll olq opr opt osbc osbr otr ple pod pvl
- q sac sbc sbl scbb schb scp scsb sct se
- sfp sfs skp sob sobb sohb sop sosb sot ssc
- st sts t tac tbc toc tp tqw trp ts
- tsc tso vbc vc viu vmll vsc vsn vwe w
- wfc wia wma wme wn x xbt xci xlp xs
+ log lop lp lsl mci mem nib ohbr okw ola
+ olc oll olq opr opt osbc osbr otr ple pod
+ pvl q sac sbc sbl scbb schb scp scsb sct
+ se sfp sfs skp sob sobb sohb sop sosb sot
+ ssc st sts t tac tbc toc tp tqw trp
+ ts tsc tso vbc vc viu vmll vsc vsn vwe
+ w wfc wia wma wme wn x xbt xci xlp
+ xs
Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be
used.
=head1 VERSION
-This man page documents perltidy version 20240202.05
+This man page documents perltidy version 20240202.06
=head1 BUG REPORTS
<h1>Perltidy Change Log</h1>
-<h2>2024 02 02.05</h2>
+<h2>2024 02 02.06</h2>
-<pre><code>- Add options --dump-mismatched-args (or -dma) and
+<pre><code>- Add option --minimize-continuation-indentation, -mci (see git #137).
+ This flag allows perltidy to remove continuation indentation in some
+ special cases where it is not really unnecessary. For a simple example,
+ the default formatting for the following snippet is:
+
+ # perltidy -nmci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+
+ The second and third lines are one level deep in a container, and
+ are also statement continuations, so they get indented by the sum
+ of the -i value and the -ci value. If this flag is set, the
+ indentation is reduced by -ci spaces, giving
+
+ # perltidy -mci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+
+ This situation is relatively rare except in code which has long
+ quoted strings and the -nolq flag is also set. This flag is currently
+ off by default, but it could become the default in a future version.
+
+- Add options --dump-mismatched-args (or -dma) and
--warn-mismatched-arg (or -wma). These options look
for and report instances where the number of args expected by a
sub appear to differ from the number passed to the sub. The -dump
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents Perl::Tidy version 20240202.05</p>
+<p>This man page documents Perl::Tidy version 20240202.06</p>
<h1 id="LICENSE">LICENSE</h1>
)
)</code></pre>
+</dd>
+<dt id="mci---minimize-continuation-indentation"><b>-mci</b>, <b>--minimize-continuation-indentation</b></dt>
+<dd>
+
+<p>This flag allows perltidy to remove continuation indentation in some special cases where it is not really unnecessary. For a simple example, the default formatting for the following snippet is:</p>
+
+<pre><code> # perltidy -nmci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );</code></pre>
+
+<p>The second and third lines are one level deep in a container, and are also statement continuations, so they get indented by the sum of the <b>-i</b> value and the <b>-ci</b> value. If this flag is set, the indentation is reduced by <b>-ci</b> spaces, giving</p>
+
+<pre><code> # perltidy -mci
+ $self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );</code></pre>
+
+<p>This flag is currently off by default, but it could become the default in a future version.</p>
+
</dd>
<dt id="sil-n---starting-indentation-level-n"><b>-sil=n</b> <b>--starting-indentation-level=n</b></dt>
<dd>
hico hih hihh hii hij hik him hin hip hipd
hipu hiq his hisc hiv hiw hsc html ibc icb
icp iob ipc isbc iscl kgb kgbd kgbi kis lal
- log lop lp lsl mem nib ohbr okw ola olc
- oll olq opr opt osbc osbr otr ple pod pvl
- q sac sbc sbl scbb schb scp scsb sct se
- sfp sfs skp sob sobb sohb sop sosb sot ssc
- st sts t tac tbc toc tp tqw trp ts
- tsc tso vbc vc viu vmll vsc vsn vwe w
- wfc wia wma wme wn x xbt xci xlp xs</code></pre>
+ log lop lp lsl mci mem nib ohbr okw ola
+ olc oll olq opr opt osbc osbr otr ple pod
+ pvl q sac sbc sbl scbb schb scp scsb sct
+ se sfp sfs skp sob sobb sohb sop sosb sot
+ ssc st sts t tac tbc toc tp tqw trp
+ ts tsc tso vbc vc viu vmll vsc vsn vwe
+ w wfc wia wma wme wn x xbt xci xlp
+ xs</code></pre>
<p>Equivalently, the prefix 'no' or 'no-' on the corresponding long names may be used.</p>
<h1 id="VERSION">VERSION</h1>
-<p>This man page documents perltidy version 20240202.05</p>
+<p>This man page documents perltidy version 20240202.06</p>
<h1 id="BUG-REPORTS">BUG REPORTS</h1>
# then the Release version must be bumped, and it is probably past time for
# a release anyway.
- $VERSION = '20240202.05';
+ $VERSION = '20240202.06';
} ## end BEGIN
sub DESTROY {
=head1 VERSION
-This man page documents Perl::Tidy version 20240202.05
+This man page documents Perl::Tidy version 20240202.06
=head1 LICENSE
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use constant EMPTY_STRING => q{};
use constant SPACE => q{ };
use strict;
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use constant EMPTY_STRING => q{};
package Perl::Tidy::FileWriter;
use strict;
use warnings;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use constant DEVEL_MODE => 0;
use constant EMPTY_STRING => q{};
use Carp;
use English qw( -no_match_vars );
use List::Util qw( min max first ); # min, max first are in Perl 5.8
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
# The Tokenizer will be loaded with the Formatter
##use Perl::Tidy::Tokenizer; # for is_keyword()
package Perl::Tidy::HtmlWriter;
use strict;
use warnings;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use Carp;
use English qw( -no_match_vars );
use strict;
use warnings;
use Carp;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use constant DEVEL_MODE => 0;
use constant EMPTY_STRING => q{};
use strict;
use warnings;
use Carp;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use constant DEVEL_MODE => 0;
use strict;
use warnings;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
BEGIN {
package Perl::Tidy::Logger;
use strict;
use warnings;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use Carp;
use English qw( -no_match_vars );
use warnings;
use English qw( -no_match_vars );
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use Carp;
{ #<<< A non-indenting brace to contain all lexical variables
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use English qw( -no_match_vars );
use Scalar::Util 'refaddr';
use Perl::Tidy::VerticalAligner::Alignment;
use strict;
use warnings;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
sub new {
my ( $class, $rarg ) = @_;
use strict;
use warnings;
-our $VERSION = '20240202.05';
+our $VERSION = '20240202.06';
use English qw( -no_match_vars );
sub AUTOLOAD {
--- /dev/null
+generate_error( msg =>
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+);
+
+subtype 'USState' => as Str => where {
+ ( exists $STATES->{code2state}{ uc($_) }
+ || exists $STATES->{state2code}{ uc($_) } );
+};
+
+$self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
--- /dev/null
+generate_error( msg =>
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+);
+
+subtype 'USState' => as Str => where {
+ ( exists $STATES->{code2state}{ uc($_) }
+ || exists $STATES->{state2code}{ uc($_) } );
+};
+
+$self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
--- /dev/null
+generate_error( msg =>
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+);
+
+subtype 'USState' => as Str => where {
+ ( exists $STATES->{code2state}{ uc($_) }
+ || exists $STATES->{state2code}{ uc($_) } );
+};
+
+$self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
--- /dev/null
+-mci -nolq -ci=4
../snippets9.t rt98902.def
../snippets9.t rt98902.rt98902
../snippets9.t rt99961.def
+../snippets29.t git137.def
+../snippets29.t git137.git137
#12 c352.def
#13 c353.c353
#14 c353.def
+#15 git137.def
+#16 git137.git137
# To locate test #13 you can search for its name or the string '#13'
----------
'git125' => "-ssp=0",
'git135' => "--valign-wide-equals",
+ 'git137' => "-mci -nolq -ci=4",
'vsn1' => <<'----------',
-vsn
-gnu
$height = $row * 25 if $row * 25 < $height;
}}}
+----------
+
+ 'git137' => <<'----------',
+generate_error( msg =>
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+);
+
+subtype 'USState' => as Str => where {
+ ( exists $STATES->{code2state}{ uc($_) }
+ || exists $STATES->{state2code}{ uc($_) } );
+};
+
+$self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
----------
'vsn' => <<'----------',
$map .= $DEFAULT_EXT unless $map =~ m|/[^/]+\.[^/]+$|;
#14...........
},
+
+ 'git137.def' => {
+ source => "git137",
+ params => "def",
+ expect => <<'#15...........',
+generate_error( msg =>
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+);
+
+subtype 'USState' => as Str => where {
+ ( exists $STATES->{code2state}{ uc($_) }
+ || exists $STATES->{state2code}{ uc($_) } );
+};
+
+$self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+#15...........
+ },
+
+ 'git137.git137' => {
+ source => "git137",
+ params => "git137",
+ expect => <<'#16...........',
+generate_error( msg =>
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+);
+
+subtype 'USState' => as Str => where {
+ ( exists $STATES->{code2state}{ uc($_) }
+ || exists $STATES->{state2code}{ uc($_) } );
+};
+
+$self->blurt( "Error: No INPUT definition for type '$type', typekind '"
+ . $type->xstype
+ . "' found" );
+#16...........
+ },
};
my $ntests = 0 + keys %{$rtests};