]> git.donarmstrong.com Git - perltidy.git/log
perltidy.git
2 years agoremove unused code, update comments
Steve Hancock [Mon, 6 Mar 2023 18:13:32 +0000 (10:13 -0800)]
remove unused code, update comments

2 years agoimprove recombine operation, c200
Steve Hancock [Sat, 4 Mar 2023 15:41:59 +0000 (07:41 -0800)]
improve recombine operation, c200

This update consolidates the three possible optimization methods in the
recombine operation into a single, simpler method which can be
shown to run in linear time.

2 years agoupdate closing side comments
Steve Hancock [Thu, 2 Mar 2023 02:03:57 +0000 (18:03 -0800)]
update closing side comments

2 years agoupdate docs
Steve Hancock [Wed, 1 Mar 2023 23:03:02 +0000 (15:03 -0800)]
update docs

2 years agofix c198
Steve Hancock [Wed, 1 Mar 2023 22:35:57 +0000 (14:35 -0800)]
fix c198

2 years agoupdate some comments and docs
Steve Hancock [Tue, 28 Feb 2023 22:40:01 +0000 (14:40 -0800)]
update some comments and docs

2 years agofix incorrect log message, issue c195
Steve Hancock [Tue, 28 Feb 2023 16:05:21 +0000 (08:05 -0800)]
fix incorrect log message, issue c195

2 years agoremove unused vars
Steve Hancock [Tue, 28 Feb 2023 03:34:40 +0000 (19:34 -0800)]
remove unused vars

2 years agofix c169
Steve Hancock [Mon, 27 Feb 2023 17:43:53 +0000 (09:43 -0800)]
fix c169

2 years agofix b1451
Steve Hancock [Mon, 27 Feb 2023 01:09:58 +0000 (17:09 -0800)]
fix b1451

2 years agoadd recombine optimization when ties are detected
Steve Hancock [Mon, 27 Feb 2023 00:20:05 +0000 (16:20 -0800)]
add recombine optimization when ties are detected

2 years agorestructure recombine operation
Steve Hancock [Fri, 24 Feb 2023 20:59:04 +0000 (12:59 -0800)]
restructure recombine operation

This avoids having a nested loop in a single sub

2 years agosimplify coding for variable _radjusted_levels_
Steve Hancock [Tue, 21 Feb 2023 20:12:16 +0000 (12:12 -0800)]
simplify coding for variable _radjusted_levels_

Coding of the array _radjusted_levels_ can be simplified since it
is now always used.  Previously it was not always available.

2 years agoremove unused vars
Steve Hancock [Mon, 20 Feb 2023 23:56:12 +0000 (15:56 -0800)]
remove unused vars

I found these with a utility I wrote to scan for unused vars.  Most are
remnants from debugging, or variables that might have been useful but
were not actually used.  I left a few unused hashes in the tokenizer which
might be useful in the future.

2 years agosimplify recombine optimization
Steve Hancock [Mon, 20 Feb 2023 19:15:56 +0000 (11:15 -0800)]
simplify recombine optimization

2 years agobe sure output batches do not end in a blank token
Steve Hancock [Sun, 19 Feb 2023 03:17:27 +0000 (19:17 -0800)]
be sure output batches do not end in a blank token

They will not be output but might cause incorrect line length calcs

2 years agosimplify calculation of some flags in sub recombine
Steve Hancock [Sun, 19 Feb 2023 00:55:47 +0000 (16:55 -0800)]
simplify calculation of some flags in sub recombine

2 years agocleanup sub check_old_breakpoints
Steve Hancock [Fri, 17 Feb 2023 23:49:21 +0000 (15:49 -0800)]
cleanup sub check_old_breakpoints

2 years agoimprove recombine reverse normal mode
Steve Hancock [Fri, 17 Feb 2023 21:43:08 +0000 (13:43 -0800)]
improve recombine reverse normal mode

2 years agofix issue c190
Steve Hancock [Fri, 17 Feb 2023 05:39:33 +0000 (21:39 -0800)]
fix issue c190

2 years agofix b1450
Steve Hancock [Fri, 17 Feb 2023 02:12:52 +0000 (18:12 -0800)]
fix b1450

2 years agoadd some tests for recombine operations
Steve Hancock [Wed, 15 Feb 2023 15:49:12 +0000 (07:49 -0800)]
add some tests for recombine operations

2 years agoadd two optimization modes to recombine operation
Steve Hancock [Wed, 15 Feb 2023 15:28:00 +0000 (07:28 -0800)]
add two optimization modes to recombine operation

This looks for two common patterns of monotonic variation in joint strengths
that can be handled very efficiently.

2 years agoadd case b1133 to convergence test files
Steve Hancock [Wed, 15 Feb 2023 14:49:51 +0000 (06:49 -0800)]
add case b1133 to convergence test files

This should have been added some time ago when the issue got resolved

2 years agosimplify code for setting comma breakpoints, part 4
Steve Hancock [Fri, 10 Feb 2023 15:27:37 +0000 (07:27 -0800)]
simplify code for setting comma breakpoints, part 4

This completes restructuring of the complex code which
forms tables. The maximum McCabe number has been reduced from
about 140 to 54 by splitting it into several subs, without any
efficiency loss or change in function. This will simplify maintenance
and debugging.

2 years agosimplify code for setting comma breakpoints, part 3
Steve Hancock [Fri, 10 Feb 2023 01:32:15 +0000 (17:32 -0800)]
simplify code for setting comma breakpoints, part 3

2 years agofix c186, c187
Steve Hancock [Wed, 8 Feb 2023 14:54:35 +0000 (06:54 -0800)]
fix c186, c187

Allow more iterations in recombine operation when the number of lines
in the script increases significantly during formatting.  In case c187,
the entire input script was a single very long line.

2 years agosimplify code for setting comma breakpoints, part 2
Steve Hancock [Wed, 8 Feb 2023 14:34:55 +0000 (06:34 -0800)]
simplify code for setting comma breakpoints, part 2

2 years agosimplify code for setting comma breakpoints, part 1
Steve Hancock [Tue, 7 Feb 2023 21:37:07 +0000 (13:37 -0800)]
simplify code for setting comma breakpoints, part 1

2 years agofix comment text
Steve Hancock [Tue, 7 Feb 2023 15:44:28 +0000 (07:44 -0800)]
fix comment text

2 years agoupdate line ending code, part 2
Steve Hancock [Mon, 6 Feb 2023 19:16:01 +0000 (11:16 -0800)]
update line ending code, part 2

2 years agoremove unused code
Steve Hancock [Mon, 6 Feb 2023 17:05:38 +0000 (09:05 -0800)]
remove unused code

2 years agoupdate output-line-ending code, part 1
Steve Hancock [Mon, 6 Feb 2023 01:36:55 +0000 (17:36 -0800)]
update output-line-ending code, part 1

Moved from Formatter.pm to Tidy.pm, a more logical place

2 years agoadd iteration convergence statistics
Steve Hancock [Mon, 6 Feb 2023 01:33:33 +0000 (17:33 -0800)]
add iteration convergence statistics

2 years agoAdd INITIALIZER comments for globals
Steve Hancock [Sun, 5 Feb 2023 22:12:22 +0000 (14:12 -0800)]
Add INITIALIZER comments for globals

Skipping the re-initialization of a global control variable can cause
bugs which are extremely difficult to track down.  So it helps to have comments
indicating where this occurs.

2 years agoremove obsolete comment about encoding
Steve Hancock [Sun, 5 Feb 2023 22:11:16 +0000 (14:11 -0800)]
remove obsolete comment about encoding

2 years agoremove duplicate code
Steve Hancock [Sun, 5 Feb 2023 19:07:11 +0000 (11:07 -0800)]
remove duplicate code

2 years agoinitialize global var $controlled_comma_style
Steve Hancock [Sun, 5 Feb 2023 16:18:28 +0000 (08:18 -0800)]
initialize global var $controlled_comma_style

2 years agoinitialize global var %matching_token in BEGIN block
Steve Hancock [Sun, 5 Feb 2023 15:32:52 +0000 (07:32 -0800)]
initialize global var %matching_token in BEGIN block

2 years agoupdate man page
Steve Hancock [Sun, 5 Feb 2023 01:32:27 +0000 (17:32 -0800)]
update man page

2 years agoavoid possibility of starting a random run twice
Steve Hancock [Sun, 5 Feb 2023 00:39:00 +0000 (16:39 -0800)]
avoid possibility of starting a random run twice

The GO.sh script is immediately moved to backup when a run starts.
That way it cannot be accidentally started again. Previously it was
moved to backup when a run ended.

2 years agoreduce max_mccabe
Steve Hancock [Fri, 3 Feb 2023 22:09:59 +0000 (14:09 -0800)]
reduce max_mccabe

The Formatter routines with highest McCabe values are currently these.
It is difficult to reduce them without significantly slowing processing.
set_bond_strengthws 121
grind_batch_of_CODE 119
set_comma_breakpoints_final 119
set_whitespace_flags 117
process_line_inner_loop 114
break_lines_inner_loop 113
set_vertical_tightness_flags 104
weld_nested_containers 101

2 years agofix b1449
Steve Hancock [Fri, 3 Feb 2023 21:53:25 +0000 (13:53 -0800)]
fix b1449

2 years agoreorganize sub check_options, part 2
Steve Hancock [Fri, 3 Feb 2023 20:02:22 +0000 (12:02 -0800)]
reorganize sub check_options, part 2

2 years agoreorgainze sub check_options, part 1
Steve Hancock [Fri, 3 Feb 2023 17:53:05 +0000 (09:53 -0800)]
reorgainze sub check_options, part 1

2 years agofix b1448
Steve Hancock [Thu, 2 Feb 2023 18:41:00 +0000 (10:41 -0800)]
fix b1448

2 years agoBump to v 20221112.05; update one-line block docs 20221112.05
Steve Hancock [Wed, 1 Feb 2023 02:14:16 +0000 (18:14 -0800)]
Bump to v 20221112.05; update one-line block docs

2 years agofix b1446
Steve Hancock [Mon, 30 Jan 2023 17:52:48 +0000 (09:52 -0800)]
fix b1446

2 years agoupdate docs for --use-feature=class
Steve Hancock [Mon, 30 Jan 2023 15:39:41 +0000 (07:39 -0800)]
update docs for --use-feature=class

This also collects info on extended syntax in a single place

2 years agofix b1447; improve sub set_whitespace_flags
Steve Hancock [Sun, 29 Jan 2023 23:57:46 +0000 (15:57 -0800)]
fix b1447; improve sub set_whitespace_flags

This should have been two commits. The first, fix b1447, is just 1 line
and will influence almost no code. The second improves the efficiency
of sub set_whitespace flags, mostly by processing comments faster. It
also fixes a minor problem with marking a sub call for special
formatting when a side comment appears between the sub name and
opening paren (issue c182).

2 years agoAdded parameter --one-line-block-exclusion-list=s
Steve Hancock [Sat, 28 Jan 2023 01:27:13 +0000 (17:27 -0800)]
Added parameter --one-line-block-exclusion-list=s

2 years agoimproved efficiency of token loop
Steve Hancock [Thu, 26 Jan 2023 18:38:16 +0000 (10:38 -0800)]
improved efficiency of token loop

2 years agoset bugtracker to be github
Steve Hancock [Wed, 25 Jan 2023 18:38:28 +0000 (10:38 -0800)]
set bugtracker to be github

2 years agobump version to .04 20221112.04
Steve Hancock [Wed, 25 Jan 2023 02:26:35 +0000 (18:26 -0800)]
bump version to .04

2 years agoissue rt#145999, keep old mtime with -b if no diff
Steve Hancock [Wed, 25 Jan 2023 02:08:52 +0000 (18:08 -0800)]
issue rt#145999, keep old mtime with -b if no diff

See the note in CHANGES.md

2 years agosimplify sub pattern testing
Steve Hancock [Tue, 24 Jan 2023 15:31:46 +0000 (07:31 -0800)]
simplify sub pattern testing

2 years agoremove unused var
Steve Hancock [Tue, 24 Jan 2023 03:33:18 +0000 (19:33 -0800)]
remove unused var

2 years agogive -kba priority over -otr (b1445)
Steve Hancock [Tue, 24 Jan 2023 01:46:00 +0000 (17:46 -0800)]
give -kba priority over -otr (b1445)

2 years agominor code cleanup
Steve Hancock [Sun, 22 Jan 2023 23:29:56 +0000 (15:29 -0800)]
minor code cleanup

2 years agoeliminate unused var _last_last_line_leading_level_
Steve Hancock [Sun, 22 Jan 2023 14:50:22 +0000 (06:50 -0800)]
eliminate unused var _last_last_line_leading_level_

2 years agoswitch from a regex to hash test
Steve Hancock [Sat, 21 Jan 2023 23:37:32 +0000 (15:37 -0800)]
switch from a regex to hash test

On my standard test case, this reduced the run time of
an if test from about 40 ms to 4 ms.

2 years agoimprove check for incorrect method call syntax, rt #145706
Steve Hancock [Sat, 21 Jan 2023 01:48:49 +0000 (17:48 -0800)]
improve check for incorrect method call syntax, rt #145706

2 years agoissue c179, rt #145706, multi-line class statement
Steve Hancock [Fri, 20 Jan 2023 22:19:32 +0000 (14:19 -0800)]
issue c179, rt #145706, multi-line class statement

This update improves the ability to automatically identify
an older style class statement if it spans multiple lines.
This avoids a needless warning message and allows the default
to be --use-feature=class.

2 years agoupdate for rt #145706
Steve Hancock [Fri, 20 Jan 2023 16:47:47 +0000 (08:47 -0800)]
update for rt #145706

2 years agofix b1444
Steve Hancock [Fri, 20 Jan 2023 15:17:08 +0000 (07:17 -0800)]
fix b1444

2 years agofix non-fatal internal fault check c177
Steve Hancock [Fri, 20 Jan 2023 01:03:38 +0000 (17:03 -0800)]
fix non-fatal internal fault check c177

add check to avoid creating an empty batch

2 years agominor simplification
Steve Hancock [Thu, 19 Jan 2023 15:01:45 +0000 (07:01 -0800)]
minor simplification

2 years agoadd expected output check for run_convergence_tests.pl
Steve Hancock [Sat, 14 Jan 2023 21:56:28 +0000 (13:56 -0800)]
add expected output check for run_convergence_tests.pl

This is a large database of weird test cases which had convergence
problems at one time in random testing. This is run after all
software updates, to be sure they all still converge.
This update adds a check for any changes in formatting.

2 years agoremove Travis-CI badge (out of date; no longer using)
Steve Hancock [Sat, 14 Jan 2023 15:49:17 +0000 (07:49 -0800)]
remove Travis-CI badge (out of date; no longer using)

2 years agomake similar line breaks for -wba='.' and -wbb='.' (c172, c174)
Steve Hancock [Sat, 14 Jan 2023 14:44:16 +0000 (06:44 -0800)]
make similar line breaks for -wba='.' and -wbb='.' (c172, c174)

The goal of this change is to make switching from breaks before '.'s
to breaks after '.'s just move the dots from the end of
lines to the beginning of lines. To do this, some special rules for
breaking before '.'s were duplicated for breaking after '.'s.

2 years agoremove unused code for alternating iteration directions
Steve Hancock [Fri, 13 Jan 2023 20:40:46 +0000 (12:40 -0800)]
remove unused code for alternating iteration directions

This worked okay but I deactivated it some time ago because there is a danger
that it could cause formatting instability (oscillating states).

2 years agoremove needless check to simplify
Steve Hancock [Fri, 13 Jan 2023 19:55:49 +0000 (11:55 -0800)]
remove needless check to simplify

2 years agosimplify coding for essential old breakpoints
Steve Hancock [Fri, 13 Jan 2023 15:53:21 +0000 (07:53 -0800)]
simplify coding for essential old breakpoints

This eliminates the need for variable _ris_essential_old_breakpoint_

2 years agolist @type_sequence_to_go now allows undefs for efficiency
Steve Hancock [Fri, 13 Jan 2023 01:38:19 +0000 (17:38 -0800)]
list @type_sequence_to_go now allows undefs for efficiency

2 years agoallow array mate_index_to_go to contain undefs
Steve Hancock [Thu, 12 Jan 2023 14:16:17 +0000 (06:16 -0800)]
allow array mate_index_to_go to contain undefs

2 years agoallow undefs in array block_type_to_go
Steve Hancock [Tue, 10 Jan 2023 14:10:56 +0000 (06:10 -0800)]
allow undefs in array block_type_to_go

2 years agooptimize use of 2 sparse arrays
Steve Hancock [Tue, 10 Jan 2023 00:02:40 +0000 (16:02 -0800)]
optimize use of 2 sparse arrays

arrays @old_breakpoints_to_go and @forced_breakpoints_to_go are sparse; it is
more efficient to rely on undefs at unused indexes instead of 0's

2 years agofix formatting
Steve Hancock [Sat, 7 Jan 2023 15:44:37 +0000 (07:44 -0800)]
fix formatting

2 years agoremove unused line
Steve Hancock [Sat, 7 Jan 2023 15:26:37 +0000 (07:26 -0800)]
remove unused line

The old parameters 'check-syntax' and 'perl-syntax-check-flags' are now
ignored but still retained to avoid breaking old .perltidyrc files.

2 years agoupdate tests for issue c171 fix (excess iterations)
Steve Hancock [Sat, 7 Jan 2023 03:17:31 +0000 (19:17 -0800)]
update tests for issue c171 fix (excess iterations)

2 years agominor optimization
Steve Hancock [Sat, 7 Jan 2023 03:17:17 +0000 (19:17 -0800)]
minor optimization

2 years agofix excessive recombine iterations, issue c171
Steve Hancock [Sat, 7 Jan 2023 00:33:39 +0000 (16:33 -0800)]
fix excessive recombine iterations, issue c171

2 years agoupdate --dump-block-summary to improve package stats
Steve Hancock [Fri, 6 Jan 2023 15:17:16 +0000 (07:17 -0800)]
update --dump-block-summary to improve package stats

This update should complete the -dbs feature implementation.

2 years agoremove travis CI config file
Steve Hancock [Wed, 4 Jan 2023 18:02:57 +0000 (10:02 -0800)]
remove travis CI config file

2 years agoadd 'mccabe_count' to variables dumped with -dbs
Steve Hancock [Wed, 4 Jan 2023 17:43:09 +0000 (09:43 -0800)]
add 'mccabe_count' to variables dumped with -dbs

2 years agobump to version 20221112.03 20221112.03
Steve Hancock [Mon, 2 Jan 2023 23:51:46 +0000 (15:51 -0800)]
bump to version 20221112.03

2 years agoadd --use-feature=class, part 2
Steve Hancock [Mon, 2 Jan 2023 23:41:56 +0000 (15:41 -0800)]
add --use-feature=class, part 2

Updates have been made to allow the default setting of --use-feature
to be --use-feature=class.  This can be turned off with --use-feature=' '.

2 years agoadd --use-feature=class, part 1
Steve Hancock [Sat, 31 Dec 2022 17:24:04 +0000 (09:24 -0800)]
add --use-feature=class, part 1

This version adds option --use-feature='class' to format code using "use feature 'class'" (see rt145706).  The main changes are:

'class' is treated as a generalization of 'package'. It is updated to accept
attributes and an optional BLOCK.

'method' is handled using the existing --sub-alias-list option,
  i.e. --sub-alias-list=method

'field' is treated the same as 'my'

'ADJUST' is treated like 'BEGIN'

In a future update, the new option --use-feature="class" will be set
to be the default.  That requires some additional updates to avoid
conflicts with older uses of these keywords.

2 years agobreak sub set_vertical_alignment_markers into two
Steve Hancock [Mon, 26 Dec 2022 21:21:21 +0000 (13:21 -0800)]
break sub set_vertical_alignment_markers into two

2 years agodelete unused code
Steve Hancock [Sun, 25 Dec 2022 16:46:54 +0000 (08:46 -0800)]
delete unused code

2 years agodivide sub xlp_collapsed_lengths into two subs
Steve Hancock [Sun, 25 Dec 2022 14:07:34 +0000 (06:07 -0800)]
divide sub xlp_collapsed_lengths into two subs

2 years agodivide sub recombine_breakpoints into two parts
Steve Hancock [Sat, 24 Dec 2022 22:53:35 +0000 (14:53 -0800)]
divide sub recombine_breakpoints into two parts

2 years agofix c167
Steve Hancock [Sat, 24 Dec 2022 00:24:10 +0000 (16:24 -0800)]
fix c167

2 years agobreak sub correct_lp_indentation_pass into two subs
Steve Hancock [Fri, 23 Dec 2022 00:04:07 +0000 (16:04 -0800)]
break sub correct_lp_indentation_pass into two subs

2 years agofix b1442
Steve Hancock [Thu, 22 Dec 2022 20:31:37 +0000 (12:31 -0800)]
fix b1442

2 years agobump version to 20221112.02 20221112.02
Steve Hancock [Wed, 21 Dec 2022 15:09:30 +0000 (07:09 -0800)]
bump version to 20221112.02

2 years agofix edge case b1443
Steve Hancock [Wed, 21 Dec 2022 14:42:23 +0000 (06:42 -0800)]
fix edge case b1443

2 years agoadd option -bfvt=n, see issue git #110
Steve Hancock [Tue, 20 Dec 2022 17:17:24 +0000 (09:17 -0800)]
add option -bfvt=n, see issue git #110

2 years agoadd --cuddeled-paren-brace, suggested in git #110
Steve Hancock [Sun, 18 Dec 2022 05:31:01 +0000 (21:31 -0800)]
add --cuddeled-paren-brace, suggested in git #110

2 years agoadd non-blank, non-comment code line count to -dbs output
Steve Hancock [Sun, 18 Dec 2022 00:55:27 +0000 (16:55 -0800)]
add non-blank, non-comment code line count to -dbs output