Perltidy TODO List
- This is a partial "wish-list" of features to add and things to do.
+ This is a partial "wish-list" of features to add and things to do. For
+ the latest list of bugs and feature requests at CPAN see:
- Perltidy not idempotent
- Perltidy does a single pass but iterates locally to try to satisfy the
- various constraints and formatting parameters, but in some cases it can
- take a second pass to reach a stable format, particularly when major
- format style changes are made. It would be useful to have a flag to
- force a second pass, say --passes=2.
-
- For now, a workaround for a single file is
-
- perltidy file.pl -st | perltidy -o file.tdy
-
- The starting indentation level is not correctly guessed when tabs are used
- When formatting a snippet which does not begin at zero indentation,
- perltidy must guess the starting indentation. The -sil flag can be used
- to specify this, but this is tedious. In general we cannot know the
- indentation and can only guess, but we can at least require that if
- perltidy is run twice on the same snippet, with the same parameters,
- that the indentation be correctly guessed on the second pass. Currently,
- this is only true if there are no tabs in the leading whitespace. A
- patch has been submitted to fix this but it needs a little work still.
-
- -b does not work through the Tidy module
- The use of -b in the following does not work:
-
- use Perl::Tidy ();
- use File::Spec;
-
- my $file = File::Spec->catfile( $dir,
- $filename );
-
- Perl::Tidy::perltidy(
- source => $file,
- argv => '-b',
- perltidyrc => $perltidyrc,
- );
-
- A temporary workaround is:
-
- Perl::Tidy::perltidy(
- argv => "-b $file",
- perltidyrc => $perltidyrc,
- );
+ https://rt.cpan.org/Public/Dist/Display.html?Name=Perl-Tidy
Improved Vertical Alignment
There are still many opportunities for improving vertical alignment.
A -r flag might be nice, but this is best handled by an exterior shell
script.
+ Make perltidy support the syntax of module XXX
+ This generally won't be done unless the module is part of the core perl
+ distribution because it is such an open-ended problem. Compounding the
+ problem is the fact that perltidy often is invoked within an editor on
+ small snippets of code, so it must to work correctly without seeing any
+ particular 'use xxx' statement. Therefore, any syntax changes that
+ conflict with standard Perl syntax can't easily be handled.
+
+ However, an effort is being made to make perltidy generally more
+ tolerant of extensions to perl syntax. Also, the pre- and post-filter
+ capabilities of the Tidy.pm module may help.
+