- Some minor issues with continuation indentation have been fixed.
Most scripts will remain unchanged. The main change is that block
comments which occur just before a closing brace, bracket or paren
- now have an indentation which is independent of the existance of
+ now have an indentation which is independent of the existence of
an optional comma or semicolon. Previously, adding or deleting
an optional trailing comma could cause their indentation to jump.
Also, indentation of comments within ternary statements has been
- improved. For additonal details see:
+ improved. For additional details see:
https://github.com/perltidy/perltidy/blob/master/docs/ci_update.md
- Added a new option '--code-skipping', requested in git #65, in which code
between comment lines '#<<V' and '#>>V' is passed verbatim to the output
- stream without error checking. It is simmilar to --format-skipping
+ stream without error checking. It is similar to --format-skipping
but there is no error checking of the skipped code. This can be useful for
skipping past code which employs an extended syntax.
will exit with a non-zero exit flag if the assertion fails.
- fixed issue RT#130297; the perltidy script now exits with a nonzero exit
- status if it wrote to the standard error output. Prevously only fatal
+ status if it wrote to the standard error output. Previously only fatal
run errors produced a non-zero exit flag. Now, even non-fatal messages
requested with the -w flag will cause a non-zero exit flag. The exit
flag now has these values:
- RT #123749, partial fix. "Continuation indentation" is removed from lines
with leading closing parens which are part of a call chain.
For example, the call to pack() is is now outdented to the starting
- indentation in the following experession:
+ indentation in the following expression:
# OLD
$mw->Button(
-it>1.
- Fixed bug where a line occasionally ended with an extra space. This reduces
- rhe number of instances where a second iteration gives a result different
+ the number of instances where a second iteration gives a result different
from the first.
- Updated documentation to note that the Tidy.pm module <stderr> parameter may
- Allow configuration file to be 'perltidy.ini' for Windows systems.
i.e. C:\Documents and Settings\User\perltidy.ini
- and added documentation for setting configuation file under Windows in man
+ and added documentation for setting configuration file under Windows in man
page. Thanks to Stuart Clark.
- Corrected problem of unwanted semicolons in hash ref within given/when code.
Thanks to Mark Olesen for suggesting this.
- -Improved alignement of '='s in certain cases.
+ -Improved alignment of '='s in certain cases.
Thanks to Norbert Gruener for sending an example.
-Outdent-long-comments (-olc) has been re-instated as a default, since
);
-Lists which do not format well in uniform columns are now better
- identified and formated.
+ identified and formatted.
OLD:
return $c->create( 'polygon', $x, $y, $x + $ruler_info{'size'},
to control what text is appended to 'else' and 'elsif' blocks.
Default is to just add leading 'if' text to an 'else'. See manual.
- -The -csc option now labels 'else' blocks with additinal information
+ -The -csc option now labels 'else' blocks with additional information
from the opening if statement and elsif statements, if space.
Thanks to Wolfgang Weisselberg for suggesting this.
'92', '94', '96', '98', '100', '102', '104'
);
- -Lists of complex items, such as matricies, are now detected
+ -Lists of complex items, such as matrices, are now detected
and displayed with just one item per row:
OLD:
if ( ( $tmp >= 0x80_00_00 ) || ( $tmp < -0x80_00_00 ) ) { }
-'**=' was incorrectly tokenized as '**' and '='. This only
- caused a problem with the -extrude opton.
+ caused a problem with the -extrude option.
-Corrected a divide by zero when -extrude option is used
To illustrate, suppose we do not want a space after a colon which introduces a
sub attribute. We need to know its type. It is not a colon because that is the
-type of a ternary operator. The ouput of B<--dump-token-types> states that it
+type of a ternary operator. The output of B<--dump-token-types> states that it
is token type 'A'. To verify this, we can run C<perltidy -D> on a short piece
of code containing such a colon, such as
because comma changes are based on the line breaks after the first iteration.
The additional computer time needed by the B<--converge> option to do another
-iteration or two will not be noticable except for files with many thousands of
+iteration or two will not be noticeable except for files with many thousands of
lines.
A parameter B<--delay-trailing-comma-operations>, or B<-dtco>, is available to
One issue with deleting a lone comma is that if it is deleted, then it
might not be possible add it back automatically since perltidy uses the
-existance of commas to help locate containers where commas are appropriate. For
+existence of commas to help locate containers where commas are appropriate. For
example, given
my ( $self, ) = @_;
- Some minor issues with continuation indentation have been fixed.
Most scripts will remain unchanged. The main change is that block
comments which occur just before a closing brace, bracket or paren
- now have an indentation which is independent of the existance of
+ now have an indentation which is independent of the existence of
an optional comma or semicolon. Previously, adding or deleting
an optional trailing comma could cause their indentation to jump.
Also, indentation of comments within ternary statements has been
- improved. For additonal details see:
+ improved. For additional details see:
https://github.com/perltidy/perltidy/blob/master/docs/ci_update.md
- Added a new option '--code-skipping', requested in git #65, in which code
between comment lines '#<<V' and '#>>V' is passed verbatim to the output
- stream without error checking. It is simmilar to --format-skipping
+ stream without error checking. It is similar to --format-skipping
but there is no error checking of the skipped code. This can be useful for
skipping past code which employs an extended syntax.
will exit with a non-zero exit flag if the assertion fails.
- fixed issue RT#130297; the perltidy script now exits with a nonzero exit
- status if it wrote to the standard error output. Prevously only fatal
+ status if it wrote to the standard error output. Previously only fatal
run errors produced a non-zero exit flag. Now, even non-fatal messages
requested with the -w flag will cause a non-zero exit flag. The exit
flag now has these values:
<pre><code>- RT #123749, partial fix. "Continuation indentation" is removed from lines
with leading closing parens which are part of a call chain.
For example, the call to pack() is is now outdented to the starting
- indentation in the following experession:
+ indentation in the following expression:
# OLD
$mw->Button(
-it>1.
- Fixed bug where a line occasionally ended with an extra space. This reduces
- rhe number of instances where a second iteration gives a result different
+ the number of instances where a second iteration gives a result different
from the first.
- Updated documentation to note that the Tidy.pm module <stderr> parameter may
<pre><code>- Allow configuration file to be 'perltidy.ini' for Windows systems.
i.e. C:\Documents and Settings\User\perltidy.ini
- and added documentation for setting configuation file under Windows in man
+ and added documentation for setting configuration file under Windows in man
page. Thanks to Stuart Clark.
- Corrected problem of unwanted semicolons in hash ref within given/when code.
Thanks to Mark Olesen for suggesting this.
--Improved alignement of '='s in certain cases.
+-Improved alignment of '='s in certain cases.
Thanks to Norbert Gruener for sending an example.
-Outdent-long-comments (-olc) has been re-instated as a default, since
);
-Lists which do not format well in uniform columns are now better
- identified and formated.
+ identified and formatted.
OLD:
return $c->create( 'polygon', $x, $y, $x + $ruler_info{'size'},
to control what text is appended to 'else' and 'elsif' blocks.
Default is to just add leading 'if' text to an 'else'. See manual.
--The -csc option now labels 'else' blocks with additinal information
+-The -csc option now labels 'else' blocks with additional information
from the opening if statement and elsif statements, if space.
Thanks to Wolfgang Weisselberg for suggesting this.
'92', '94', '96', '98', '100', '102', '104'
);
--Lists of complex items, such as matricies, are now detected
+-Lists of complex items, such as matrices, are now detected
and displayed with just one item per row:
OLD:
if ( ( $tmp >= 0x80_00_00 ) || ( $tmp < -0x80_00_00 ) ) { }
-'**=' was incorrectly tokenized as '**' and '='. This only
- caused a problem with the -extrude opton.
+ caused a problem with the -extrude option.
-Corrected a divide by zero when -extrude option is used
```
The first line now has a different indentation from the rest, and this is
-undesirable because ideally indentation should be independent of the existance
+undesirable because ideally indentation should be independent of the existence
of side comments. The new version handles this correctly:
```
alert for the double encoding problem, and how to reset the default if
necessary. This is also the reason for waiting some time before the second step was made.
-If double encoding does appear to be occuring with the change in the default for some program which calls Perl::Tidy, then a quick emergency fix can be made by the program user by setting **-neos** to revert to the old default. A better fix can eventually be made by the program author by removing the second encoding using a technique such as illustrated above.
+If double encoding does appear to be occurring with the change in the default for some program which calls Perl::Tidy, then a quick emergency fix can be made by the program user by setting **-neos** to revert to the old default. A better fix can eventually be made by the program author by removing the second encoding using a technique such as illustrated above.
## Summary
The source can only be in 'C' mode if it arrives by a call from another Perl
program, and the destination can only be in 'C' mode if the destination is a
Perl program. Otherwise, if the destination is a file, or object with a print
-method, then it will be assumed to be ending its existance as a Perl string and
+method, then it will be assumed to be ending its existence as a Perl string and
will be placed in an end state which is 'B' mode.
Transition from a starting 'B' mode to 'C' mode is done by a decoding operation
Let us make a list of all possible sets of string storage modes to be sure that
all cases are covered. If each of the three stages list above (entry,
-intermedite, and exit) could be in 'B' or 'C' mode then we would have a total
+intermediate, and exit) could be in 'B' or 'C' mode then we would have a total
of 2 x 2 x 2 = 8 combinations of states. Each end point may either be a file
or a string reference. Here is a list of them, with a note indicating which
ones are possible, and when:
</code></pre>
<p>The <a href="./INSTALL.html">INSTALL file</a> has additional installation notes. They
-are mainly for older sytems but also tell how to use perltidy without doing an installation.</p>
+are mainly for older systems but also tell how to use perltidy without doing an installation.</p>
<h2>Links</h2>
make install
The [INSTALL file](./INSTALL.html) has additional installation notes. They
-are mainly for older sytems but also tell how to use perltidy without doing an installation.
+are mainly for older systems but also tell how to use perltidy without doing an installation.
## Links
<p>It is necessary to have a list of all token types in order to create this type of input. Such a list can be obtained by the command <b>--dump-token-types</b>. Also try the <b>-D</b> flag on a short snippet of code and look at the <i>.DEBUG</i> file to see the tokenization.</p>
-<p>To illustrate, suppose we do not want a space after a colon which introduces a sub attribute. We need to know its type. It is not a colon because that is the type of a ternary operator. The ouput of <b>--dump-token-types</b> states that it is token type 'A'. To verify this, we can run <code>perltidy -D</code> on a short piece of code containing such a colon, such as</p>
+<p>To illustrate, suppose we do not want a space after a colon which introduces a sub attribute. We need to know its type. It is not a colon because that is the type of a ternary operator. The output of <b>--dump-token-types</b> states that it is token type 'A'. To verify this, we can run <code>perltidy -D</code> on a short piece of code containing such a colon, such as</p>
<pre><code> sub foo : lvalue;</code></pre>
</li>
</ul>
-<p>One issue with deleting a lone comma is that if it is deleted, then it might not be possible add it back automatically since perltidy uses the existance of commas to help locate containers where commas are appropriate. For example, given</p>
+<p>One issue with deleting a lone comma is that if it is deleted, then it might not be possible add it back automatically since perltidy uses the existence of commas to help locate containers where commas are appropriate. For example, given</p>
<pre><code> my ( $self, ) = @_;</code></pre>
unshift( @Arg_files, '-' );
}
- # check file existance and expand any globs
+ # check file existence and expand any globs
else {
my @updated_files;
foreach my $input_file (@Arg_files) {
# Usage Outline:
#
-# STEP 1: initialize or re-initialze Formatter with user options
+# STEP 1: initialize or re-initialize Formatter with user options
# Perl::Tidy::Formatter::check_options($rOpts);
#
# STEP 2: crate a tokenizer for the source stream
# The opening depth should always be defined, and
# it should equal $nesting_depth-1. To protect
- # against unforseen error conditions, however, we
+ # against unforeseen error conditions, however, we
# will check this and fix things if necessary. For
# a test case see issue c055.
my $opening_depth = $rdepth_of_opening_seqno->[$seqno];
# skip a blank line
next if ( !defined($Kfirst) );
- # check for a lable
+ # check for a label
if ( $rLL->[$Kfirst]->[_TYPE_] eq 'J' ) {
$label = $rLL->[$Kfirst]->[_TOKEN_];
last;
}
# Both 'sub' and 'asub' select an anonymous sub.
- # This allows anonymous subs to be explicitely selected
+ # This allows anonymous subs to be explicitly selected
elsif (
$ris_asub_block->{$seqno}
&& ( $dump_all_types
# For example, key='$pack' with code=3 is short for '$pack*'
# which will match '$package', '$packer', etc
- # Loop over all possible matchs
+ # Loop over all possible matches
foreach ( @{$rwildcard_match_list} ) {
my ( $key, $code ) = @{$_};
my $len_key = length($key);
sub scan_call_parens {
my ($self) = @_;
- # Perform a scan requesed by --want-call-parens
+ # Perform a scan requested by --want-call-parens
# We search for selected functions or keywords and for a following paren.
# A warning is issued if the paren existence is not what is wanted
# according to the setting --want-call-parens.
my ( $rcomma, $rblank );
- # Note: orignally just for ',' but now also for '->'
+ # Note: originally just for ',' but now also for '->'
# case 1: pop comma from top of stack
if ( $rLL_new->[-1]->[_TYPE_] eq $type ) {
# if outer container is paren, must be sub call or list assignment
# Note that _ris_function_call_paren_ does not currently include
- # calls of the form '->(', so that has to be checked separetely.
+ # calls of the form '->(', so that has to be checked separately.
if ( $token eq '('
&& !$self->[_ris_function_call_paren_]->{$type_sequence}
&& !$is_arrow_call
}
}
- #--------------------------------------------
- # compare caller/sub return counts if posible
- #--------------------------------------------
+ #---------------------------------------------
+ # compare caller/sub return counts if possible
+ #---------------------------------------------
# rhs check: only check subs returning finite lists (i.e. not '@list');
next if ($return_count_indefinite);
# We have a list spanning multiple lines and are trying
# to decide the best way to set comma breakpoints.
- # Overriden variables
+ # Overridden variables
my $item_count = $rhash_A->{_item_count_A};
my $identifier_count = $rhash_A->{_identifier_count_A};
# Returns:
# - nothing if nothing more to do
- # - a ref to a hash containg some derived parameters
+ # - a ref to a hash containing some derived parameters
# Variables from caller
my $i_opening_paren = $rhash_IN->{i_opening_paren};
#
# Usage Outline:
#
-# STEP 1: initialize or re-initialze Tokenizer with user options
+# STEP 1: initialize or re-initialize Tokenizer with user options
# Perl::Tidy::Tokenizer::check_options($rOpts);
#
# STEP 2: create a tokenizer for a specific input source object
my $self = shift;
- # TEST 1: class stmt can only go where a new statment can start
+ # TEST 1: class stmt can only go where a new statement can start
if ( !new_statement_ok() ) { return }
my $i_beg = $i + 1;
G user-defined function taking block parameter (like grep/map/eval)
S sub definition (reported as type 'i' in older versions)
P package definition (reported as type 'i' in older versions)
- t type indicater such as %,$,@,*,&,sub
+ t type indicator such as %,$,@,*,&,sub
w bare word (perhaps a subroutine call)
i identifier of some type (with leading %, $, @, *, &, sub, -> )
n a number
my $is_blocked = defined( $blocking_level[$ng] )
&& $lev > $blocking_level[$ng];
- # TAIL-WAG-DOG RULE: prevent a 'tail-wag-dog' syndrom, meaning:
+ # TAIL-WAG-DOG RULE: prevent a 'tail-wag-dog' syndrome, meaning:
# Do not let one or two lines with a **different number of
# alignments** open up a big gap in a large block. For
# example, we will prevent something like this, where the first
$list_type = $line->{'list_type'};
$ci_level = $line->{'ci_level'};
- # Quick approxmiate check for signed numbers in this line.
+ # Quick approximate check for signed numbers in this line.
# This speeds up large runs by about 0.5%
if ( !$saw_signed_number ) {
# Finish formatting a column of unsigned numbers
# Given:
- # $rgroup_lines - the current vertical aligment group of lines
+ # $rgroup_lines - the current vertical alignment group of lines
# $rcol_hash - a hash of information about this vertical column
# $ix_last - index of the last line of this vertical column
# Task:
# Finish formatting a column of wide equals
# Given:
- # $rgroup_lines - the current vertical aligment group of lines
+ # $rgroup_lines - the current vertical alignment group of lines
# $rcol_hash - a hash of information about this vertical column
# $ix_last - index of the last line of this vertical column
# Checklist for preparing a new version and/or release
- basic quality control:
- - 'make test' successful for all commit canditates
+ - 'make test' successful for all commit candidates
- run 'devbin/run__convergence_tests.pl' for all commit candidates
- Run perlcritic
- run NYTProf and check the activity and performance of all changed code